CandlestickChart with Tooltip
<?xml version="1.0" encoding="iso-8859-1"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
[Bindable]
public var myData:Array = [
{date: "1-Aug-10", open: 42.57, high: 43.08, low: 42.08, close: 42.75},
{date: "11-Aug-10", open: 43.39, high: 44.12, low: 43.25, close: 44},
{date: "12-Aug-10", open: 43.46, high: 46.22, low: 43.36, close: 46.1},
];
public var myData2:Array = [
{date: "11-Aug-10", open: 43.39, high: 44.12, low: 43.25, close: 44},
{date: "1-Aug-10", open: 42.57, high: 43.08, low: 42.08, close: 42.75},
{date: "12-Aug-10", open: 43.46, high: 46.22, low: 43.36, close: 46.1},
];
public var myData3:Array = [
{date: "12-Aug-10", open: 43.46, high: 46.22, low: 43.36, close: 46.1},
{date: "11-Aug-10", open: 43.39, high: 44.12, low: 43.25, close: 44},
{date: "1-Aug-10", open: 42.57, high: 43.08, low: 42.08, close: 42.75},
];
</mx:Script>
<mx:CandlestickChart id="mychart" dataProvider="{myData}" showDataTips="true" height="400" width="400">
<mx:series>
<mx:CandlestickSeries dataProvider="{myData}"
openField="open"
highField="high"
lowField="low"
closeField="close"
displayName="My Data"/>
<mx:CandlestickSeries dataProvider="{myData2}"
openField="open"
highField="high"
lowField="low"
closeField="close"
displayName="My Data2"/>
<mx:CandlestickSeries dataProvider="{myData3}"
openField="open"
highField="high"
lowField="low"
closeField="close"
displayName="My Data3"/>
</mx:series>
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="date" title="Date"/>
</mx:horizontalAxis>
<mx:horizontalAxisRenderer>
<mx:AxisRenderer canDropLabels="true"/>
</mx:horizontalAxisRenderer>
</mx:CandlestickChart>
<mx:Legend dataProvider="{mychart}" direction="horizontal"/>
</mx:Application>
Related examples in the same category