Flex で BarChart を使用しようとしています。フィードした ArrayCollection の順序に従ってバーを並べ替えたいと思います。つまり、インデックス 0 のデータは一番上の最初の棒になります。しかし、Flex はまったく逆の順序を教えてくれます。つまり、インデックス 0 のデータは一番下の最後のバーではありません。
ArrayCollection の順序を逆にする以外に、BarChart に順序を逆にするように指示するにはどうすればよいですか? ありがとう!!
私のスクリプトタグのコードブロックは次のとおりです。
[Bindable]
private var optionsArray:ArrayCollection = new ArrayCollection([
new VotingOption('Yes, it rocks!', 'yes', 5),
new VotingOption('Meh, it is okay!', 'ok', 10),
new VotingOption('No, it sucks!', 'no', 15)
]);
そして、ここに私のBarChartコードがあります:
<mx:BarChart x="9.1" y="8" id="barchart1" width="563.0303" height="454.01514" maxBarWidth="30"
type="overlaid" dataProvider="{optionsArray}" showAllDataTips="true">
<mx:verticalAxis>
<mx:CategoryAxis id="vertAxis" categoryField="optionSMSCode"/>
</mx:verticalAxis>
<mx:verticalAxisRenderers>
<mx:AxisRenderer axis="{vertAxis}" showLabels="false"/>
</mx:verticalAxisRenderers>
<mx:series>
<mx:BarSeries xField="optionResult" showDataEffect="morph"/>
</mx:series>
</mx:BarChart>