CSS for BarSeries and ColumnSeries
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:Style>
@namespace mx "http://www.adobe.com/2006/mxml";
mx|BarSeries, mx|ColumnSeries {
fills:#333333,#999999,#CCCCCC;
}
</mx:Style>
<mx:Model id="salesModel">
<data>
<row>
<fruit>A</fruit>
<sales>1</sales>
</row>
<row>
<fruit>B</fruit>
<sales>2</sales>
</row>
</data>
</mx:Model>
<mx:ArrayCollection id="salesData" source="{salesModel.row}"/>
<mx:Panel title="Bar Chart" height="100%" width="100%">
<mx:BarChart dataProvider="{salesData}" height="100%" width="100%">
<mx:verticalAxis>
<mx:CategoryAxis dataProvider="{salesData}" categoryField="fruit"/>
</mx:verticalAxis>
<mx:series>
<mx:BarSeries xField="sales" yField="fruit"/>
</mx:series>
</mx:BarChart>
</mx:Panel>
<mx:Panel title="Column Chart" height="100%" width="100%">
<mx:ColumnChart dataProvider="{salesData}" height="100%" width="100%">
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{salesData}" categoryField="fruit"/>
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries xField="fruit" yField="sales"/>
</mx:series>
</mx:ColumnChart>
</mx:Panel>
</mx:Application>
Related examples in the same category