PieChart vs ColumnChart : Column Chart « Chart « Flex






PieChart vs ColumnChart

PieChart vs ColumnChart
           
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="#EEEEEE">
  <mx:Style>
  @namespace mx "http://www.adobe.com/2006/mxml";
    mx|ColumnSeries
    {
      fill:#000000;
    }
    mx|ColumnChart, DataGrid
    {
      font-size:12;
      font-weight:bold;
    }
  </mx:Style>

  <mx:ArrayCollection id="salesData">
    <mx:Object>
      <mx:fruit>A</mx:fruit>
      <mx:sales>4</mx:sales>
    </mx:Object>
    <mx:Object>
      <mx:fruit>B</mx:fruit>
      <mx:sales>2</mx:sales>
    </mx:Object>
    <mx:Object>
      <mx:fruit>C</mx:fruit>
      <mx:sales>5</mx:sales>
    </mx:Object>
  </mx:ArrayCollection>

  <mx:Spacer height="20"/>

  <mx:ColumnChart dataProvider="{salesData}" width="500" height="100%">
    <mx:horizontalAxis>
      <mx:CategoryAxis dataProvider="{salesData}" categoryField="fruit"/>
    </mx:horizontalAxis>
    <mx:series>
      <mx:ColumnSeries xField="fruit" yField="sales" displayName="Sales"/>
    </mx:series>
  </mx:ColumnChart>
  
  <mx:PieChart dataProvider="{salesData}">
    <mx:series>
      <mx:PieSeries field="sales" nameField="fruit" labelField="fruit" labelPosition="inside"/>
    </mx:series>
  </mx:PieChart>
  
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.ColumnChart DemoColumnChart Demo
2.Waterfall Stacked ColumnChartWaterfall Stacked ColumnChart
3.Create a PieChart control from the selected columns in the ColumnChart control.Create a PieChart control from the selected columns in the ColumnChart control.
4.Column Chart Demo and CategoryAxisColumn Chart Demo and CategoryAxis
5.Combine column chart and pie chartCombine column chart and pie chart
6.Using strokes in ActionScriptUsing strokes in ActionScript
7.You can also represent the range of dates in MXML by using the following syntax:You can also represent the range of dates in MXML by using the following syntax:
8.Creating a custom Legend controlCreating a custom Legend control
9.Stack the Profit and Expenses fields, in which some of the values are negative.Stack the Profit and Expenses fields, in which some of the values are negative.
10.Add new grid lines as annotation elements to the chart and an image as the background elementAdd new grid lines as annotation elements to the chart and an image as the background element
11.Define the grid lines inside each chart control's definitionDefine the grid lines inside each chart control's definition
12.Turns on grid lines in both directions and applies them to the chart:Turns on grid lines in both directions and applies them to the chart:
13.Define set of filters, and then applies them to various chart elements:Define set of filters, and then applies them to various chart elements:
14.Mixed ChartMixed Chart
15.Multiple Axis ChartMultiple Axis Chart
16.Display two chartsDisplay two charts
17.Define two colors and then uses those colors in the axis renderers and in the strokes and fills for the chart itemsDefine two colors and then uses those colors in the axis renderers and in the strokes and fills for the chart items
18.Make Chart From Drag DropMake Chart From Drag Drop