Setup CandlestickChart : Candlestick Chart « Chart « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Chart » Candlestick ChartScreenshots 
Setup CandlestickChart
Setup CandlestickChart
        

<?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
1.Candlestick chart displaying stock pricesCandlestick chart displaying stock prices
2.Candlestick Chart Heigh field and Low fieldCandlestick Chart Heigh field and Low field
3.Axis for Candlestick ChartAxis for Candlestick Chart
4.Legend for Candlestick ChartLegend for Candlestick Chart
5.Candlestick Chart Axis Label Rotation ExampleCandlestick Chart Axis Label Rotation Example
6.CandlestickChartCandlestickChart
7.Define the properties of the high-low lines and candlestick borders by using a Stroke classDefine the properties of the high-low lines and candlestick borders by using a Stroke class
8.Create a CandlestickChart controlCreate a CandlestickChart control
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.