Packagecom.amcharts
Classpublic class AmXYChart
InheritanceAmXYChart Inheritance AmRectangularChart Inheritance AmCoordinateChart Inheritance AmChart Inheritance mx.core.UIComponent

AmXYChart is a class used to display XY or Scatter or Bubble charts.

View the examples.



Public Properties
 PropertyDefined by
 InheritedautoMargins : Boolean
Specifies if margins of a chart where axes are will be calculated automatically by the maximum width of a axis label.
AmRectangularChart
 Inheritedballoon : AmBalloon
An instance of com.amcharts.AmBalloon.
AmChart
 InheritedchartCursor : ChartCursor
Chart cursor.
AmRectangularChart
 InheritedchartScrollbar : ChartScrollbar
Chart scrollbar.
AmRectangularChart
 InheritedchartType : String
returns chart type (serial, xy, or radar).
AmCoordinateChart
 InheritedclipContent : Boolean
Specifies if the chart contents which goes outside the chart area should be clipped or not.
AmChart
 InheriteddataProvider : Object
Specifies the data provider for the chart.
AmChart
 Inheritedgraphs : Array
The array of graphs belonging to this chart.
AmCoordinateChart
 Inheritedlegend : AmLegend
Chart legend.
AmChart
  maxZoomFactor : Number
Maximum zoom factor.
AmXYChart
 InheritedmouseWheelEnabled : Boolean
Specifies if zooming/scrolling with mouse wheel is enabled.
AmRectangularChart
 InheritednumberFormatter : NumberFormatter
An instance of mx.formatters.NumberFormatter.
AmChart
 InheritedpercentFormatter : NumberFormatter
An instance of mx.formatters.NumberFormatter.
AmChart
 InheritedprefixesOfBigNumbers : Array
Array of objects with prefixes for big numbers.
AmChart
 InheritedprefixesOfSmallNumbers : Array
Array of objects with prefixes for small numbers.
AmChart
 InheritedtrendLines : Array
Array of trend lines.
AmRectangularChart
 InheritedurlTarget : String
The target of the url.
AmCoordinateChart
 InheritedusePrefixes : Boolean
If true, prefixes will be used for big and small numbers.
AmChart
 InheritedvalueAxes : Array
The array of value axes.
AmCoordinateChart
 InheritedzoomOutButton : Object
Zoom-out button, visible when chart is zoomed-in.
AmRectangularChart
 InheritedzoomOutText : String
Text in the zoom-out button.
AmRectangularChart
Public Methods
 MethodDefined by
  
Constructor.
AmXYChart
 Inherited
Adds a graph (series) to the chart.
AmCoordinateChart
 Inherited
Adds a trend line to the chart.
AmRectangularChart
 Inherited
Adds value axis to the chart.
AmCoordinateChart
 Inherited
animateAgain():void
The animation is played only once or if you change the animation styles.
AmCoordinateChart
 Inherited
Destorys all listeners.
AmRectangularChart
 Inherited
getGraphById(id:String):AmGraph
Returns graph by id.
AmCoordinateChart
 Inherited
Returns value Axis by id.
AmCoordinateChart
 Inherited
hideGraph(graph:AmGraph):void
Hide the graph (if it is visible).
AmCoordinateChart
 Inherited
Hide value balloon of a graph.
AmCoordinateChart
 Inherited
highlightGraph(graph:AmGraph):void
Highlight the graph.
AmCoordinateChart
 Inherited
In case data inside your dataProvider was changed, you can call this method to rebuild the chart.
AmChart
 Inherited
Makes the chart to recalculate margin width and redraw.
AmRectangularChart
 Inherited
Removes cursor from the chart.
AmRectangularChart
 Inherited
Removes scrollbar from the chart.
AmRectangularChart
 Inherited
removeGraph(graph:AmGraph):void
Removes graph from the chart.
AmCoordinateChart
 Inherited
removeTrendLine(trendLine:TrendLine):void
Removes trend line from the chart.
AmRectangularChart
 Inherited
removeValueAxis(valueAxis:ValueAxis):void
Removes value axis from the chart.
AmCoordinateChart
 Inherited
showGraph(graph:AmGraph):void
Show the graph (if it is hidden).
AmCoordinateChart
 Inherited
Show value balloon of a graph.
AmCoordinateChart
 Inherited
UnhighlightGraph the graph.
AmCoordinateChart
  
zoomOut():void
Zooms out the chart.
AmXYChart
Protected Methods
 MethodDefined by
 Inherited
setAxisRotation(valueAxis:ValueAxis):void
AmRectangularChart
Events
 EventSummaryDefined by
 Inherited Dispatched when the user clicks on a data item (column/bullet).AmCoordinateChart
 Inherited Dispatched when the chart was updated with new data, when dataProvider or data inside dataProvider was changed.AmChart
 Inherited Dispatched when the user double clicks on a data item (column/bullet).AmCoordinateChart
 Inherited Dispatched when chart margin was updated (only if autoMargins is set to true) AmRectangularChart
 Inherited Dispatched when the user rolls out of the data item (column/bullet).AmCoordinateChart
 Inherited Dispatched when the user rolls over data item (column/bullet).AmCoordinateChart
Styles
 StyleDescriptionDefined by
 Inherited Type: Number   CSS Inheritance: no
The angle of the 3D part of plot area.
AmRectangularChart
 Inherited Type: uint   Format: Color   CSS Inheritance: yes
Color of text in the component, including the component label.
AmChart
 Inherited Type: Array   Format: Color   CSS Inheritance: no
Specifies the colors of the graphs if the color is not set.
AmCoordinateChart
 Inherited Type: Number   CSS Inheritance: no
The depth of the 3D part of plot area.
AmRectangularChart
 Inherited Type: uint   Format: Color   CSS Inheritance: yes
Color of text in the component if it is disabled.
AmChart
 Inherited Type: String   CSS Inheritance: yes
Sets the antiAliasType property of internal TextFields.
AmChart
 Inherited Type: String   CSS Inheritance: yes
Name of the font to use.
AmChart
 Inherited Type: String   CSS Inheritance: yes
Sets the gridFitType property of internal TextFields that represent text in Flex controls.
AmChart
 Inherited Type: Number   CSS Inheritance: yes
Sets the sharpness property of internal TextFields that represent text in Flex controls.
AmChart
 Inherited Type: Number   Format: Length   CSS Inheritance: yes
Height of the text, in pixels.
AmChart
 Inherited Type: String   CSS Inheritance: yes
Determines whether the text is italic font.
AmChart
 Inherited Type: Number   CSS Inheritance: yes
Sets the thickness property of internal TextFields that represent text in Flex controls.
AmChart
 Inherited Type: String   CSS Inheritance: yes
Determines whether the text is boldface.
AmChart
 Inherited Type: Boolean   CSS Inheritance: yes
A Boolean value that indicates whether kerning is enabled (true) or disabled (false).
AmChart
 Inherited Type: Number   CSS Inheritance: yes
The number of additional pixels to appear between each character.
AmChart
 Inherited Type: Number   CSS Inheritance: no
Number of pixels between the container's bottom border and plot area.
AmRectangularChart
 Inherited Type: Number   CSS Inheritance: no
Number of pixels between the container's left border and plot area.
AmRectangularChart
 Inherited Type: Number   CSS Inheritance: no
Number of pixels between the container's right border and plot area.
AmRectangularChart
 Inherited Type: Number   CSS Inheritance: no
Number of pixels between the container's top border and plot area.
AmRectangularChart
 Inherited Type: Number   CSS Inheritance: no
The opacity of plot area's border.
AmCoordinateChart
 Inherited Type: uint   Format: Color   CSS Inheritance: no
The color of the plot area's border.
AmCoordinateChart
 Inherited Type: Array   CSS Inheritance: no
Specifies the alphas used to tint the background gradient fill of the plot area.
AmCoordinateChart
 Inherited Type: Array   Format: Color   CSS Inheritance: no
Specifies the colors used to tint the background gradient fill of the plot area.
AmCoordinateChart
 Inherited Type: Boolean   CSS Inheritance: no
Specifies whether the animation should be sequenced or all objects should appear at once.
AmCoordinateChart
 Inherited Type: Number   CSS Inheritance: no
The initial opacity of the column/line.
AmCoordinateChart
 Inherited Type: Number   CSS Inheritance: no
Duration of the animation, in seconds.
AmCoordinateChart
 Inherited Type: Function   CSS Inheritance: no
Animation effect.
AmCoordinateChart
 Inherited Type: String   CSS Inheritance: no
Direction from which line graphs should fly-in.
AmCoordinateChart
 Inherited Type: String   CSS Inheritance: yes
Alignment of text within a container.
AmChart
 Inherited Type: String   CSS Inheritance: yes
Determines whether the text is underlined.
AmChart
 Inherited Type: Number   Format: Length   CSS Inheritance: yes
Offset of first line of text from the left side of the container, in pixels.
AmChart
Property detail
maxZoomFactorproperty
maxZoomFactor:Number  [read-write]

Maximum zoom factor.

The default value is 20.

Implementation
    public function get maxZoomFactor():Number
    public function set maxZoomFactor(value:Number):void
Constructor detail
AmXYChart()constructor
public function AmXYChart()

Constructor.

Method detail
zoomOut()method
public function zoomOut():void

Zooms out the chart.

Examples
bubbleChart
<?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([
                {x:6, y:5, value:15},
                {x:10, y:2.9, value:19},
                {x:5, y:8.0, value:5},
                {x:9, y:1.6, value:13},
                {x:2, y:6.2, value:22},
                {x:5, y:9.4, value:15},
                {x:11, y:2.2, value:8}            
            ]);    
        ]]>
    </mx:Script>
    
    
    <amcharts:AmXYChart
        width="100%"
        height="100%"
        id="chart"
        dataProvider="{chartData}"
        startDuration="1">
        <amcharts:graphs>
            <amcharts:AmGraph 
                id="g0"
                xField="x"
                yField="y"
                valueField="value" 
                lineAlpha="0" 
                bullet="bubble"
                itemColors="[0xFF6600,0xFCD202,0xB0DE09,0x0D8ECF,0x2A0CD0,0xCD0D74,0xCC0000]"/>                        
        </amcharts:graphs>
        
        <amcharts:chartCursor>
            <amcharts:ChartCursor>                    
            </amcharts:ChartCursor>
        </amcharts:chartCursor>            
        
        <amcharts:chartScrollbar>
            <amcharts:ChartScrollbar hideResizeGrips="false" height="20">                    
            </amcharts:ChartScrollbar>    
        </amcharts:chartScrollbar>
        
    </amcharts:AmXYChart>
    
</mx:Application>
bullsEyeChart
<?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([
                // bubbles
                {x:6, y:5, value:15},
                {x:10, y:2.9, value:19},
                {x:5, y:8.0, value:5},
                {x:-9, y:-1.6, value:13},
                {x:-2, y:-6.2, value:22},
                {x:5, y:9.4, value:15},
                {x:11, y:2.2, value:8},
                {x:-10, y:-7.2, value:4},
                {x:-7, y:-5.2, value:9},
                {x:2, y:5.9, value:2},
                {x:-10, y:-11.2, value:20},
                // positive rectangle
                {px:0, py: 0},
                {px:0, py: 100},
                {px:100, py: 100},
                {px:100, py: 0},
                {px:0, py: 0},
                // negative rectangle
                {nx:0, ny: 0},
                {nx:0, ny: -100},
                {nx:-100, ny: -100},
                {nx:-100, ny: 0},
                {nx:0, ny: 0},                        
            ]);    
        ]]>
    </mx:Script>
    
    
    <amcharts:AmXYChart
        width="100%"
        height="100%"
        id="chart"
        autoMargins="false"
        marginTop="0"
        marginRight="0"
        marginLeft="0"
        marginBottom="0"
        dataProvider="{chartData}">
        <amcharts:graphs>
            <!-- bubble graph -->
            <amcharts:AmGraph                 
                lineColor="0xFFCC00"
                xField="x"
                yField="y"
                valueField="value" 
                lineAlpha="0" 
                bullet="bubble"
                balloonText="x:[[x]] y:[[y]] value:[[value]]"
                />
            <!-- positive rectangle -->
            <amcharts:AmGraph
                xField="px"
                yField="py"
                lineColor="0xCC3333"
                lineAlpha="0"
                fillAlphas="[0.5]"
                includeInMinMax="false"/>
            <!-- negative rectangle -->
            <amcharts:AmGraph
                xField="nx"
                yField="ny"
                lineColor="0x0066CC"
                lineAlpha="0"
                fillAlphas="[0.5]"
                includeInMinMax="false"/>                
            
        </amcharts:graphs>
        
        <amcharts:valueAxes>
            <amcharts:ValueAxis position="bottom" inside="true" tickLength="0" labelsEnabled="false"/>
            <amcharts:ValueAxis position="left" inside="true" tickLength="0" labelsEnabled="false"/>
        </amcharts:valueAxes>
        
        <amcharts:chartCursor>
            <amcharts:ChartCursor>                    
            </amcharts:ChartCursor>
        </amcharts:chartCursor>            
        
        <amcharts:chartScrollbar>
            <amcharts:ChartScrollbar height="20">                    
            </amcharts:ChartScrollbar>    
        </amcharts:chartScrollbar>
        
    </amcharts:AmXYChart>
    
</mx:Application>
scatterChart
<?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([
                // scatter points            
                {ax:1, ay:0.5, bx:1, by:2.2},
                {ax:2, ay:1.3, bx:2, by:4.9},
                {ax:3, ay:2.3, bx:3, by:5.1},
                {ax:4, ay:2.8, bx:4, by:5.3},
                {ax:5, ay:3.5, bx:5, by:6.1},
                {ax:6, ay:5.1, bx:6, by:8.3},
                {ax:7, ay:6.7, bx:7, by:10.5},
                {ax:8, ay:8.0, bx:8, by:12.3},
                {ax:9, ay:8.9, bx:9, by:14.5},
                {ax:10, ay:9.7, bx:10, by:15.0},
                {ax:11, ay:10.4, bx:11, by:18.8},
                {ax:12, ay:11.7, bx:12, by:19.0},
                // trend graphs
                {agx:12, agy:11, bgx:12, bgy:19},
                {agx:1, agy:1, bgx:1, bgy:2}            
            ]);    
        ]]>
    </mx:Script>
    
    
    <amcharts:AmXYChart
        width="100%"
        height="100%"
        id="chart"
        dataProvider="{chartData}"
        startDuration="1">
        <amcharts:graphs>
            <amcharts:AmGraph balloonText="x:[[x]] y:[[y]]" xField="ax" yField="ay" lineAlpha="0" bullet="triangleDown"/>
            <amcharts:AmGraph balloonText="x:[[x]] y:[[y]]" xField="bx" yField="by" lineAlpha="0" bullet="square"/>
            <amcharts:AmGraph balloonText="x:[[x]] y:[[y]]" xField="agx" yField="agy" lineThickness="2" lineColor="0xFF6600"/>
            <amcharts:AmGraph balloonText="x:[[x]] y:[[y]]" xField="bgx" yField="bgy" lineThickness="2" lineColor="0xFCD202"/>                        
        </amcharts:graphs>
        
        <amcharts:valueAxes>
            <amcharts:ValueAxis position="left" gridCount="20" labelFrequency="2"/>
            <amcharts:ValueAxis position="bottom" gridCount="20"/>                
        </amcharts:valueAxes>
        
        <amcharts:chartCursor>
            <amcharts:ChartCursor>                    
            </amcharts:ChartCursor>
        </amcharts:chartCursor>            
        
        <amcharts:chartScrollbar>
            <amcharts:ChartScrollbar hideResizeGrips="false" height="20">                    
            </amcharts:ChartScrollbar>    
        </amcharts:chartScrollbar>
        
    </amcharts:AmXYChart>
    
</mx:Application>