Class AmGraph

AmGraph class displays all types of graphs - line, column, step line, smoothed line, ohlc and candlestick.

example

var chart = new AmCharts.AmSerialChart(); var graph = new AmCharts.AmGraph(); graph.valueField = 'value'; graph.type = 'column'; graph.fillAlphas = 1; chart.addGraph(graph);

Hierarchy

Index

Properties

Properties

public alphaField: string

Name of the alpha field in your dataProvider.

public balloonColor: string

Value balloon color. Will use graph or data item color if not set.

public balloonText: string

Balloon text. You can use tags like value, description, percents, [[open]], category value

public behindColumns: boolean

Specifies if the line graph should be placed behind column graphs

public bullet: string

Type of the bullets. Possible values are: "none", "round", "square", "triangleUp", "triangleDown", "bubble", "custom". none

public bulletAlpha: number

Opacity of bullets. Value range is 0 - 1.

default

1

public bulletBorderAlpha: number

Bullet border opacity.

default

1

public bulletBorderColor: string

Bullet border color. Will use lineColor if not set.

public bulletBorderThickness: number

Bullet border thickness.

default

2

public bulletColor: string

Bullet color. Will use lineColor if not set.

public bulletField: string

Name of the bullet field in your dataProvider.

public bulletOffset: number

Bullet offset. Distance from the actual data point to the bullet. Can be used to place custom bullets above the columns.

public bulletSize: number

Bullet size.

default

8

public bulletSizeField: string

Name of the bullet size field in your dataProvider.

public closeField: string

Name of the close field (used by candlesticks and ohlc) in your dataProvider.

public color: string

Color of value labels. Will use chart's color if not set.

public colorField: string

Name of the color field in your dataProvider.

public connect: boolean

Specifies whether to connect data points if data is missing. The default value is true.

default

true

public cornerRadiusTop: number

Corner radius of column. It can be set both in pixels or in percents. The chart's depth and angle styles must be set to 0. The default value is 0. Note, cornerRadiusTop will be applied for all corners of the column, JavaScript charts do not have a possibility to set separate corner radius for top and bottom. As we want all the property names to be the same both on JS and Flex, we didn't change this too.

public cursorBulletAlpha: number

If bulletsEnabled of ChartCurosor is true, a bullet on each graph follows the cursor. You can set opacity of each graphs bullet. In case you want to disable these bullets for a certain graph, set opacity to 0.

default

1

public customBullet: string

Path to the image of custom bullet.

public customBulletField: string

Name of the custom bullet field in your dataProvider.

public dashLength: number

Dash length. If you set it to a value greater than 0, the graph line will be dashed.

public descriptionField: string

Name of the description field in your dataProvider.

public fillAlphas: number

Opacity of fill. Plural form is used to keep the same property names as our Flex charts'. Flex charts can accept array of numbers to generate gradients. Although you can set array here, only first value of this array will be used.

public fillColors: any

Fill color. Will use lineColor if not set.

public fillColorsField: string

Name of the fill colors field in your dataProvider.

public fillToGraph: AmGraph

You can set another graph here and if fillAlpha is >0, the area from this graph to fillToGraph will be filled (instead of filling the area to the X axis).

public fontSize: number

Size of value labels text. Will use chart's fontSize if not set.

public gradientOrientation: string

Orientation of the gradient fills (only for "column" graph type). Possible values are "vertical" and "horizontal". vertical

public hidden: boolean

Specifies whether the graph is hidden. Do not use this to show/hide the graph, use hideGraph(graph) and showGraph(graph) methods instead.

public hideBulletsCount: number

If there are more data points than hideBulletsCount, the bullets will not be shown. 0 means the bullets will always be visible.

public highField: string

Name of the high field (used by candlesticks and ohlc) in your dataProvider.

public includeInMinMax: boolean

Whether to include this graph when calculating min and max value of the axis.

default

true

public labelColorField: string

Name of label color field in data provider.

public labelPosition: string

Position of value label. Possible values are: "bottom", "top", "right", "left", "inside", "middle". Sometimes position is changed by the chart, depending on a graph type, rotation, etc. top

public labelText: string

Value label text. You can use tags like value, description, percents, [[open]], category.

public legendAlpha: number

Legend marker opacity. Will use lineAlpha if not set. Value range is 0 - 1.

public legendColor: string

Legend marker color. Will use lineColor if not set.

public legendValueText: string

Legend value text. You can use tags like value, description, percents, [[open]], category You can also use custom fields from your dataProvider. If not set, uses Legend's valueText.

public lineAlpha: number

Opacity of the line (or column border). Value range is 0 - 1.

default

1

public lineColor: string

Color of the line (or column border). If you do not set any, the color from [[AmCoordinateChart

public lineColorField: string

Name of the line color field (used by columns and candlesticks only) in your dataProvider.

public lineThickness: number

Specifies thickness of the graph line (or column border).

default

1

public lowField: string

Name of the low field (used by candlesticks and ohlc) in your dataProvider.

public markerType: string

Legend marker type. You can set legend marker (key) type for individual graphs. Possible values are: "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble".

public maxBulletSize: number

Specifies size of the bullet which value is the biggest (XY chart).

default

50

public minBulletSize: number

Specifies minimum size of the bullet (XY chart).

public negativeBase: number

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.

public negativeFillAlphas: number

Fill opacity of negative part of the graph. Will use fillAlphas if not set.

public negativeFillColors: any

Fill color of negative part of the graph. Will use fillColors if not set.

public negativeLineColor: string

Color of the line (or column) when the values are negative. In case the graph type is candlestick or ohlc, negativeLineColor is used when close value is less then open value.

public numberFormatter: Object

Example: {precision:-1, decimalSeparator:'.', thousandsSeparator:','}. The graph uses this object's values to format the numbers. Uses chart's numberFormatter if not defined.

public openField: string

Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider.

public pointPosition: string

Specifies where data points should 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". middle

public showAllValueLabels: boolean

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.

public showBalloon: boolean

Specifies whether the value balloon of this graph is shown when mouse is over data item or chart's indicator is over some series.

default

true

public showBalloonAt: string

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". close

public stackable: boolean

If the value axis of this graph has stack types like "regular" or "100%" You can exclude this graph from stacking.

default

true

public title: string

Graph title.

public type: string

Type of the graph. Possible values are: "line", "column", "step", "smoothedLine", "candlestick", "ohlc". XY and Radar charts can only display "line" type graphs. line

public urlField: string

Name of the url field in your dataProvider.

public urlTarget: string

Target to open URLs in, i.e. _blank, _top, etc.

public valueAxis: ValueAxis

Specifies which value axis the graph will use. Will use the first value axis if not set.

public valueField: string

Name of the value field in your dataProvider.

public visibleInLegend: boolean

Specifies whether this graph should be shown in the Legend.

default

true

public xAxis: ValueAxis

XY chart only. A horizontal value axis object to attach graph to.

public xField: string

XY chart only. Name of the x field in your dataProvider.

public yAxis: ValueAxis

XY chart only. A vertical value axis object to attach graph to.

public yField: string

XY chart only. Name of the y field in your dataProvider.