ColumnChart with Color Gradient : Column Chart Style « Chart « Flex






ColumnChart with Color Gradient

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

1.Use SolidColorStoke to paint horizontalStrokeUse SolidColorStoke to paint horizontalStroke
2.Use SolidColorStoke to paint verticalStrokeUse SolidColorStoke to paint verticalStroke
3.Set fill colorSet fill color
4.background Elements for ColumnChartbackground Elements for ColumnChart
5.Remove Shadows for ColumnChartRemove Shadows for ColumnChart
6.Fill column with LinearGradientFill column with LinearGradient
7.Use GridLines as backgroundUse GridLines as background
8.LinearGradient fillLinearGradient fill
9.Formatting grid lines with ActionScriptFormatting grid lines with ActionScript
10.Formatting grid lines with MXMLFormatting grid lines with MXML
11.Chart With StyleChart With Style
12.Apply a custom drop shadow filter to a ColumnChart controlApply a custom drop shadow filter to a ColumnChart control
13.Creates a floating ColumnChart controlCreates a floating ColumnChart control
14.Alternatively, you can set the gutter properties inlineAlternatively, you can set the gutter properties inline
15.Define a custom component inline by using the tag.Define a custom component inline by using the <fx:Component> tag.
16.specify the x, y, height, and width properties of a rectangular range.specify the x, y, height, and width properties of a rectangular range.
17.Add background to chartAdd background to chart
18.Add new grid lines as annotation elements to the chart and an image as the background element.Add new grid lines as annotation elements to the chart and an image as the background element.
19.Add an image to the chart and manipulate its propertiessAdd an image to the chart and manipulate its propertiess
20.Style tickStrokeStyle tickStroke
21.Style minorTickStrokeStyle minorTickStroke
22.Disabling axis labelsDisabling axis labels
23.Change the label alignment for the vertical and horizontal axes.Change the label alignment for the vertical and horizontal axes.