これは私の問題です。類似したデータを持つ「月」という属性のarraycollectionを持っています 月:「2月」5回。私のアプリケーションを実行すると、データは "Feb"の画面には表示されません。つまり、カラムチャートは表示されません。 誰も私にこの問題を解決するための理由や回避策を教えてもらえますか? 次のコードを見つけてください: - 、このようないくつかのことを行うフレックス・チャート重複した項目を含むColumnChartが表示されない
<mx:Script>
<![CDATA[
import mx.charts.series.ColumnSeries;
import mx.collections.ArrayCollection;
[Bindable] private var expenses:ArrayCollection = new
ArrayCollection([
{Month:"Jan", Profit:1000, Expenses:1500, Amount:450},
{Month:"Feb", Profit:500, Expenses:200, Amount:600},
{Month:"Feb", Profit:1500, Expenses:500, Amount:300},
{Month:"Feb", Profit:2000, Expenses:1500, Amount:450},
{Month:"Feb", Profit:1000, Expenses:200, Amount:600},
{Month:"Feb", Profit:1500, Expenses:500, Amount:300},
{Month:"Feb", Profit:2000, Expenses:1500, Amount:450},
{Month:"Aug", Profit:1000, Expenses:200, Amount:600},
{Month:"Sept", Profit:1500, Expenses:500, Amount:300},
{Month:"Oct", Profit:2000, Expenses:1500, Amount:450},
{Month:"Nov", Profit:1000, Expenses:200, Amount:600},
{Month:"Dec", Profit:1500, Expenses:500, Amount:300}
]);
private function clickHandler():void
{
var columnSeries:Array = new Array();
var series:ColumnSeries = new ColumnSeries();
categoryAxis.categoryField = series.xField = "Month";
series.yField = "Profit";
series.displayName = "Profit";
columnSeries.push(series);
myChart.series = columnSeries;
series.percentWidth = 100;
series.percentHeight = 100;
myChart.dataProvider = expenses;
}
]]>
</mx:Script>
<mx:VBox horizontalAlign="center" width="100%" height="100%" creationComplete="clickHandler()">
<mx:ColumnChart id="myChart" width="90%" showDataTips="true" height="90%" >
<mx:horizontalAxis>
<mx:CategoryAxis id="categoryAxis" categoryField="Month" />
</mx:horizontalAxis>
</mx:ColumnChart>
</mx:VBox>
こんにちはラジェッシュ、あなたの答えのおかげで、私はあなたの概念を使用し、自分のコードにいくつかの変更を行い、それが私のために動作します。もう一度感謝.....コードが追加されました: - categoryAxis.displayName = "月"は、x軸に "月"を表示するのに役立ちます。ここでの "id"はUniqueデータを表すUniqueキーです。 –