ColumnChart with Color Gradient
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import mx.collections.ArrayCollection;
[Bindable]
public var myArray:ArrayCollection = new ArrayCollection([
{Country:"A", GDP:1},
{Country:"B", GDP:6},
{Country:"C", GDP:4},
{Country:"D", GDP:2}
]);
</mx:Script>
<mx:Panel title="Column Chart">
<mx:ColumnChart id="myChart" dataProvider="{myArray}" showDataTips="true">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="Country"/>
</mx:horizontalAxis>
<mx:fill>
<mx:LinearGradient>
<mx:entries>
<mx:GradientEntry color="0xC5C551" ratio="0" alpha="1" />
<mx:GradientEntry color="0xECEC21" ratio=".66" alpha=".2" />
</mx:entries>
</mx:LinearGradient>
</mx:fill>
<mx:series>
<mx:ColumnSeries
dataProvider="{myArray}"
yField="GDP"
xField="Country"
displayName="Array"/>
</mx:series>
</mx:ColumnChart>
<mx:Legend dataProvider="{myChart}"/>
</mx:Panel>
</mx:Application>
Related examples in the same category