| Package | com.amcharts.chartClasses |
| Class | public class AmGraph |
| Inheritance | AmGraph mx.core.UIComponent |
| Property | Defined by | ||
|---|---|---|---|
| alphaField : String
Name of the alpha field in your dataProvider.
| AmGraph | ||
| balloonText : String
Balloon text.
| AmGraph | ||
| bulletConfigField : String
Name of the bullet config field.
| AmGraph | ||
| bulletField : String
Name of the bullet field in your dataProvider.
| AmGraph | ||
| bulletSizeField : String
Name of the bullet size field in your dataProvider.
| AmGraph | ||
| categoryField : String
Name of the category field (only required if a separate dataProvider for this graph is set).
| AmGraph | ||
| centerCustomBullets : Boolean
Specifies whether custom bullets should be centered or not.
| AmGraph | ||
| closeField : String
Name of the close field (used by candlesticks and ohlc) in your dataProvider.
| AmGraph | ||
| colorField : String
Name of the color field in your dataProvider.
| AmGraph | ||
| combineSeries : Boolean
Set this to true if you set a separate data provider for this graph
and your data has series which are not included in the main data provider
and you want the chart to combine series from both data providers.
| AmGraph | ||
| customBullet : *
Custom bullet (class or path to file name).
| AmGraph | ||
| customBulletField : String
Name of the custom bullet field in your dataProvider.
| AmGraph | ||
| dataPointCount : Number [read-only]
returns number of data points with not null value
| AmGraph | ||
| dataProvider : Object
Specifies the data provider for the graph, in case it is different from Chart's data provider.
| AmGraph | ||
| descriptionField : String
Name of the description field in your dataProvider.
| AmGraph | ||
| fillColorsField : String
Name of the fill colors field in your dataProvider.
| AmGraph | ||
| hidden : Boolean
Specifies whether the graph is hidden.
| AmGraph | ||
| highField : String
Name of the high field (used by candlesticks and ohlc) in your dataProvider.
| AmGraph | ||
| yAxis : ValueAxis
XY chart only: specifies which vertical value axis the graph will use.
| AmGraph | ||
| yField : String
Name of the y field in your dataProvider (XY chart only).
| AmGraph | ||
| ignoreOpenValue : Boolean
line and step line graphs can show "ranges" - fills between "open" and "value" values.
| AmGraph | ||
| includeInMinMax : Boolean
Whether to include this graph when calculating min and max value of the axis.
| AmGraph | ||
| itemColors : Array
Every data item (column, bullet) can use a different color from this array.
| AmGraph | ||
| labelText : String
Value label text.
| AmGraph | ||
| legendValueText : String
Legend value text.
| AmGraph | ||
| lowField : String
Name of the low field (used by candlesticks and ohlc) in your dataProvider.
| AmGraph | ||
| markerType : String
Legend marker type.
| AmGraph | ||
| maxBulletSize : Number
Maximum size of a bullet (XY chart, when bullet's size depends on a value).
| AmGraph | ||
| minBulletSize : Number
Minimum size of a bullet (XY chart, when bullet's size depends on a value).
| AmGraph | ||
| negativeBase : Number
If you use different colors for your negative values, a graph below zero line is filled with negativeColor.
| AmGraph | ||
| numberFormatter : NumberFormatter
An instance of mx.formatters.NumberFormatter.
| AmGraph | ||
| openField : String
Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider.
| AmGraph | ||
| pointPosition : String
Specifies where data points should be placed.
| AmGraph | ||
| seriesIdField : String
Name of the category field (only required if a separate dataProvider for this graph is set).
| AmGraph | ||
| showAllValueLabels : Boolean
if graph's type is column and labelText is set, graph hides labels which do not fit into the column's space.
| AmGraph | ||
| showBalloon : Boolean
Specifies whether the value balloon of this graph is shown on the indicator.
| AmGraph | ||
| showBalloonAt : String
Specifies graphs value at which cursor is showed.
| AmGraph | ||
| showBulletAt : String
Specifies graphs value at which balloon is showed.
| AmGraph | ||
| stackable : Boolean
If the value axis of this graph has stack types like "regular" or "100%" you can exclude this graph from stacking.
| AmGraph | ||
| type : String
Type of the graph.
| AmGraph | ||
| title : String
Graph title.
| AmGraph | ||
| urlField : String
Name of the url field in your dataProvider.
| AmGraph | ||
| valueAxis : ValueAxis
Specifies which value axis the graph will use.
| AmGraph | ||
| valueField : String
Name of the value field in your dataProvider.
| AmGraph | ||
| visibleInLegend : Boolean
Specifies whether this graph should be shown in the Legend.
| AmGraph | ||
| xAxis : ValueAxis
XY chart only: specifies which horizontal value axis the graph will use.
| AmGraph | ||
| xField : String
Name of the x field in your dataProvider (XY chart only).
| AmGraph | ||
| Method | Defined by | ||
|---|---|---|---|
|
AmGraph()
Constructor.
| AmGraph | ||
|
hideBullets():void
Hide bullets.
| AmGraph | ||
|
showBullets():void
Show bullets.
| AmGraph | ||
| alphaField | property |
alphaField:String [read-write]Name of the alpha field in your dataProvider.
Implementation public function get alphaField():String
public function set alphaField(value:String):void
| balloonText | property |
balloonText:String [read-write]Balloon text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[total]], [[category]]. You can also use custom fields from your dataProvider.
The default value is [[value]].
public function get balloonText():String
public function set balloonText(value:String):void
| bulletConfigField | property |
bulletConfigField:String [read-write]Name of the bullet config field. Bullet config field can contain an object which will be passed to the bullet using set bulletConfig method.
Implementation public function get bulletConfigField():String
public function set bulletConfigField(value:String):void
| bulletField | property |
bulletField:String [read-write]Name of the bullet field in your dataProvider.
Implementation public function get bulletField():String
public function set bulletField(value:String):void
| bulletSizeField | property |
bulletSizeField:String [read-write]Name of the bullet size field in your dataProvider.
Implementation public function get bulletSizeField():String
public function set bulletSizeField(value:String):void
| categoryField | property |
categoryField:String [read-write]Name of the category field (only required if a separate dataProvider for this graph is set). Uses chart's category field if not set any.
Implementation public function get categoryField():String
public function set categoryField(value:String):void
| centerCustomBullets | property |
centerCustomBullets:Boolean [read-write]Specifies whether custom bullets should be centered or not.
The default value is false.
public function get centerCustomBullets():Boolean
public function set centerCustomBullets(value:Boolean):void
| closeField | property |
closeField:String [read-write]Name of the close field (used by candlesticks and ohlc) in your dataProvider.
Implementation public function get closeField():String
public function set closeField(value:String):void
| colorField | property |
colorField:String [read-write]Name of the color field in your dataProvider.
Implementation public function get colorField():String
public function set colorField(value:String):void
| combineSeries | property |
combineSeries:Boolean [read-write]Set this to true if you set a separate data provider for this graph and your data has series which are not included in the main data provider and you want the chart to combine series from both data providers.
The default value is false.
public function get combineSeries():Boolean
public function set combineSeries(value:Boolean):void
| customBullet | property |
customBullet:* [read-write]Custom bullet (class or path to file name).
Implementation public function get customBullet():*
public function set customBullet(value:*):void
| customBulletField | property |
customBulletField:String [read-write]Name of the custom bullet field in your dataProvider.
Implementation public function get customBulletField():String
public function set customBulletField(value:String):void
| dataPointCount | property |
dataPointCount:Number [read-only]returns number of data points with not null value
Implementation public function get dataPointCount():Number
| dataProvider | property |
dataProvider:Object [read-write]Specifies the data provider for the graph, in case it is different from Chart's data provider.
This property can accept an Array, ArrayCollection or IList.
Implementation public function get dataProvider():Object
public function set dataProvider(value:Object):void
| descriptionField | property |
descriptionField:String [read-write]Name of the description field in your dataProvider.
Implementation public function get descriptionField():String
public function set descriptionField(value:String):void
| fillColorsField | property |
fillColorsField:String [read-write]Name of the fill colors field in your dataProvider. Using this field you can fill individual columns or candlesticks with custom color gradients.
Implementation public function get fillColorsField():String
public function set fillColorsField(value:String):void
| hidden | property |
hidden:Boolean [read-write]Specifies whether the graph is hidden. Do not use this to show/hide the graph, use hideGraph(graph) and showGraph(graph) methods instead.
The default value is false.
public function get hidden():Boolean
public function set hidden(value:Boolean):void
| highField | property |
highField:String [read-write]Name of the high field (used by candlesticks and ohlc) in your dataProvider.
Implementation public function get highField():String
public function set highField(value:String):void
| yAxis | property |
yAxis:ValueAxis [read-write]XY chart only: specifies which vertical value axis the graph will use. Will use the first vertical value axis if not set.
Implementation public function get yAxis():ValueAxis
public function set yAxis(value:ValueAxis):void
| yField | property |
yField:String [read-write]Name of the y field in your dataProvider (XY chart only).
Implementation public function get yField():String
public function set yField(value:String):void
| ignoreOpenValue | property |
ignoreOpenValue:Boolean [read-write]line and step line graphs can show "ranges" - fills between "open" and "value" values. in order to achieve this, openField must be specified and this setting, ignoreOpenValue should be set to false.
The default value is true.
public function get ignoreOpenValue():Boolean
public function set ignoreOpenValue(value:Boolean):void
| includeInMinMax | property |
includeInMinMax:Boolean [read-write]Whether to include this graph when calculating min and max value of the axis.
The default value is true.
public function get includeInMinMax():Boolean
public function set includeInMinMax(value:Boolean):void
| itemColors | property |
itemColors:Array [read-write]Every data item (column, bullet) can use a different color from this array.
The default value is undefined.
public function get itemColors():Array
public function set itemColors(value:Array):void
| labelText | property |
labelText:String [read-write]Value label text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[total]], [[category]]. You can also use custom fields from your dataProvider.
The default value is undefined.
public function get labelText():String
public function set labelText(value:String):void
| legendValueText | property |
legendValueText:String [read-write]Legend value text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[total]], [[category]] You can also use custom fields from your dataProvider. If not set, uses Legend's valueText.
Implementation public function get legendValueText():String
public function set legendValueText(value:String):void
| lowField | property |
lowField:String [read-write]Name of the low field (used by candlesticks and ohlc) in your dataProvider.
Implementation public function get lowField():String
public function set lowField(value:String):void
| markerType | property |
markerType:String [read-write]Legend marker type. You can set legend marker (key) type for individual graphs. Possible values are: "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble".
The default value is undefined.
public function get markerType():String
public function set markerType(value:String):void
| maxBulletSize | property |
maxBulletSize:Number [read-write]Maximum size of a bullet (XY chart, when bullet's size depends on a value).
The default value is 50.
public function get maxBulletSize():Number
public function set maxBulletSize(value:Number):void
| minBulletSize | property |
minBulletSize:Number [read-write]Minimum size of a bullet (XY chart, when bullet's size depends on a value).
The default value is 0.
public function get minBulletSize():Number
public function set minBulletSize(value:Number):void
| negativeBase | property |
negativeBase:Number [read-write]If you use different colors for your negative values, a graph below zero line is filled with negativeColor. With this property you can define a different base value at which colors should be changed to negative colors.
The default value is 0.
public function get negativeBase():Number
public function set negativeBase(value:Number):void
| numberFormatter | property |
numberFormatter:NumberFormatter [read-write]An instance of mx.formatters.NumberFormatter. The graph uses this class to format the numbers. Uses Chart's numberFormatter if not defined.
The default value is undefined.
public function get numberFormatter():NumberFormatter
public function set numberFormatter(value:NumberFormatter):void
| openField | property |
openField:String [read-write]Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider. It can also be used by line and step line graphs, but you should set ignoreOpenValue to false in this case.
Implementation public function get openField():String
public function set openField(value:String):void
| pointPosition | property |
pointPosition:String [read-write]Specifies where data points should be placed. They can be placed on the beginning of the period (day, hour, etc) or in the middle (only when parseDates property of categoryAxis is set to true). This setting affects Serial chart only. Possible values are "start" and "middle".
The default value is middle.
public function get pointPosition():String
public function set pointPosition(value:String):void
| seriesIdField | property |
seriesIdField:String [read-write]Name of the category field (only required if a separate dataProvider for this graph is set). Uses chart's category field if not set any.
Implementation public function get seriesIdField():String
public function set seriesIdField(value:String):void
| showAllValueLabels | property |
showAllValueLabels:Boolean [read-write]if graph's type is column and labelText is set, graph hides labels which do not fit into the column's space. If you don't want these labels to be hidden, set this to true.
The default value is false.
public function get showAllValueLabels():Boolean
public function set showAllValueLabels(value:Boolean):void
| showBalloon | property |
showBalloon:Boolean [read-write]Specifies whether the value balloon of this graph is shown on the indicator.
The default value is true.
public function get showBalloon():Boolean
public function set showBalloon(value:Boolean):void
| showBalloonAt | property |
showBalloonAt:String [read-write]Specifies graphs value at which cursor is showed. This is only important for candlestick and ohlc charts, also if column chart has "open" value. Possible values are: "open", "close", "high", "low".
The default value is close.
public function get showBalloonAt():String
public function set showBalloonAt(value:String):void
| showBulletAt | property |
showBulletAt:String [read-write]Specifies graphs value at which balloon is showed. This is only important for candlestick and ohlc charts. Possible values are: "open", "close", "high", "low".
The default value is close.
public function get showBulletAt():String
public function set showBulletAt(value:String):void
| stackable | property |
stackable:Boolean [read-write]If the value axis of this graph has stack types like "regular" or "100%" you can exclude this graph from stacking.
The default value is true.
public function get stackable():Boolean
public function set stackable(value:Boolean):void
| type | property |
type:String [read-write]Type of the graph. Possible values are: line, column, step, smoothedLine, candlestick, ohlc. XY and Radar charts can only display "line" type graphs.
The default value is line.
public function get type():String
public function set type(value:String):void
| title | property |
title:String [read-write]Graph title.
The default value is undefined.
public function get title():String
public function set title(value:String):void
| urlField | property |
urlField:String [read-write]Name of the url field in your dataProvider.
Implementation public function get urlField():String
public function set urlField(value:String):void
| valueAxis | property |
valueAxis:ValueAxis [read-write]Specifies which value axis the graph will use. Will use the first value axis if not set.
Implementation public function get valueAxis():ValueAxis
public function set valueAxis(value:ValueAxis):void
| valueField | property |
valueField:String [read-write]Name of the value field in your dataProvider.
Implementation public function get valueField():String
public function set valueField(value:String):void
| visibleInLegend | property |
visibleInLegend:Boolean [read-write]Specifies whether this graph should be shown in the Legend.
The default value is true.
public function get visibleInLegend():Boolean
public function set visibleInLegend(value:Boolean):void
| xAxis | property |
xAxis:ValueAxis [read-write]XY chart only: specifies which horizontal value axis the graph will use. Will use the first horizontal value axis if not set.
Implementation public function get xAxis():ValueAxis
public function set xAxis(value:ValueAxis):void
| xField | property |
xField:String [read-write]Name of the x field in your dataProvider (XY chart only).
Implementation public function get xField():String
public function set xField(value:String):void
| AmGraph | () | constructor |
public function AmGraph()Constructor.
| hideBullets | () | method |
public function hideBullets():voidHide bullets.
| showBullets | () | method |
public function showBullets():voidShow bullets.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:amcharts="http://www.amcharts.com/com_internal"
layout="absolute"
backgroundColor="#FFFFFF"
width="100%"
height="100%" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var chartData:ArrayCollection = new ArrayCollection([
{year:"2000",a:20,b:5,c:10,d:5},
{year:"2001",a:21,b:6,c:10,d:10},
{year:"2002",a:24,b:7,c:9,d:10},
{year:"2003",a:21,b:5,c:10,d:8},
{year:"2004",a:24,b:4,c:10,d:8},
{year:"2005",a:26,b:8,c:10,d:9},
{year:"2006",a:27,b:9,c:12,d:9},
{year:"2007",a:29,b:9,c:13,d:8},
{year:"2008",a:30,b:10,c:14,d:7},
{year:"2009",a:26,b:12,c:15,d:8},
{year:"2010",a:24,b:11,c:13,d:9},
{year:"2011",a:22,b:14,c:11,d:8},
{year:"2012",a:21,b:16,c:11,d:7},
{year:"2013",a:20,b:17,c:13,d:6},
{year:"2014",a:15,b:19,c:13,d:5},
{year:"2015",a:14,b:18,c:14,d:3}
]);
]]>
</mx:Script>
<mx:HBox backgroundColor="#FFFFFF" width="100%" height="100%">
<mx:VBox width="50%" height="100%">
<!-- first chart -->
<amcharts:AmSerialChart
width="100%"
height="100%"
id="chart"
dataProvider="{chartData}"
categoryField="year"
plotAreaFillAlphas="[0]">
<amcharts:graphs>
<amcharts:AmGraph
color="#FFFFFF"
title="Sample a"
valueField="a"
type="line"
lineThickness="2"
lineAlpha="1"
fillAlphas="[0.7]"
showBalloon="false"/>
<amcharts:AmGraph
color="#FFFFFF"
title="Sample b"
valueField="b"
type="line"
lineThickness="2"
lineAlpha="1"
fillAlphas="[0.7]"/>
<amcharts:AmGraph
color="#FFFFFF"
title="Sample c"
valueField="c"
type="line"
lineThickness="2"
lineAlpha="1"
fillAlphas="[0.7]"
showBalloon="false"/>
<amcharts:AmGraph
color="#FFFFFF"
title="Sample d"
valueField="d"
type="line"
lineThickness="2"
lineAlpha="1"
fillAlphas="[0.7]"/>
</amcharts:graphs>
<amcharts:valueAxes>
<amcharts:ValueAxis stackType="regular" gridAlpha="0.1"/>
</amcharts:valueAxes>
<amcharts:categoryAxis>
<amcharts:CategoryAxis gridAlpha="0.1" fontWeight="bold" startOnAxis="true" position="top"/>
</amcharts:categoryAxis>
<amcharts:chartScrollbar>
<amcharts:ChartScrollbar height="20"/>
</amcharts:chartScrollbar>
<amcharts:chartCursor>
<amcharts:ChartCursor/>
</amcharts:chartCursor>
</amcharts:AmSerialChart>
<amcharts:AmLegend
fontWeight="bold"
reversedOrder="true"
rollOverGraphAlpha="0.1"
dataProvider="{chart}"
width="100%"
marginLeft="35"
marginRight="15"
markerType="circle"
switchType="v"/>
</mx:VBox>
<mx:VBox width="50%" height="100%">
<!-- Second chart - almost the same, only rotated -->
<amcharts:AmSerialChart
rotate="true"
width="100%"
height="100%"
id="chart2"
dataProvider="{chartData}"
categoryField="year"
plotAreaFillAlphas="[0]">
<amcharts:graphs>
<amcharts:AmGraph
color="#FFFFFF"
title="Sample a"
valueField="a"
type="step"
lineThickness="2"
lineAlpha="1"
fillAlphas="[0.7]"
balloonText="[[percents]]%"/>
<amcharts:AmGraph
color="#FFFFFF"
title="Sample b"
valueField="b"
type="step"
lineThickness="2"
lineAlpha="1"
fillAlphas="[0.7]"
showBalloon="false"
balloonText="[[percents]]%"/>
<amcharts:AmGraph
color="#FFFFFF"
title="Sample c"
valueField="c"
type="step"
lineThickness="2"
lineAlpha="1"
fillAlphas="[0.7]"
showBalloon="false"
balloonText="[[percents]]%"/>
<amcharts:AmGraph
color="#FFFFFF"
title="Sample d"
valueField="d"
type="step"
lineThickness="2"
lineAlpha="1"
fillAlphas="[0.7]"
balloonText="[[percents]]%"/>
</amcharts:graphs>
<amcharts:valueAxes>
<amcharts:ValueAxis stackType="100%" gridAlpha="0.1"/>
</amcharts:valueAxes>
<amcharts:categoryAxis>
<amcharts:CategoryAxis gridAlpha="0.1" fontWeight="bold" startOnAxis="true" position="left"/>
</amcharts:categoryAxis>
<amcharts:chartScrollbar>
<amcharts:ChartScrollbar height="20"/>
</amcharts:chartScrollbar>
<amcharts:chartCursor>
<amcharts:ChartCursor/>
</amcharts:chartCursor>
</amcharts:AmSerialChart>
<amcharts:AmLegend
markerType="square"
fontWeight="bold"
reversedOrder="true"
rollOverGraphAlpha="0.1"
dataProvider="{chart2}"
width="100%"
marginLeft="52"
marginRight="15"
switchType="x"
valueText="[[percents]]%"
valueAlign="right"/>
</mx:VBox>
</mx:HBox>
</mx:Application>