Skip to content

GaugeAxis

Type class

Creates an axis for AmAngularGauge charts, multiple can be assigned.

Example

```js var chart = AmCharts.makeChart("chartdiv",{ ... "axes": [ { "startValue": 0, "endValue": 100, "valueInterval": 10, "bands": [ { "startValue": 0, "endValue": 100 } ] } ] });```

Sources

This information about GaugeAxis is provided for reference only and is not available through exported packages and thus should not be imported or used on its own.

Inheritance

GaugeAxis does not extend any other symbol.

GaugeAxis is not extended by any other symbol.

Properties

axisAlpha

Type numberDefault 1

Axis opacity.

axisColor

Type colorDefault #000000

Axis color.

axisThickness

Type numberDefault 1

Thickness of the axis outline.

bandAlpha

Type numberDefault 1

Opacity of band fills.

bandGradientRatio

Type number[]Default []

Example: [-0.2, 0, -0.2]. Will make bands to be filled with color gradients. Negative value means the color will be darker than the original, and positive number means the color will be lighter.

bandOutlineAlpha

Type numberDefault 0

Opacity of band outlines.

bandOutlineColor

Type colorDefault #000000

Color of band outlines.

bandOutlineThickness

Type numberDefault 0

Thickness of band outlines.

bands

Type GaugeBand[]

Array of bands - GaugeBand objects. Bands are used to draw color fills between specified values.

bottomText

Type string

Text displayed below the axis center.

bottomTextBold

Type booleanDefault true

Specifies if text should be bold.

bottomTextColor

Type color

Bottom text color.

bottomTextFontSize

Type number

Font size of bottom text.

bottomTextYOffset

Type numberDefault 0

Y offset of bottom text.

centerX

Type number/stringDefault 0%

X position of the axis, relative to the center of the gauge.

centerY

Type number/stringDefault 0%

Y position of the axis, relative to the center of the gauge.

color

Type color

Specifies labels color of the axis.

endAngle

Type numberDefault 120

Axis end angle. Valid values are from - 180 to 180.

endValue

Type number

Axis end (max) value

fontSize

Type number

Font size for axis labels.

gridCount

Type numberDefault 5

Number of grid lines. Note, GaugeAxis doesn't adjust gridCount, so you should check your values and choose a proper gridCount which would result grids at round numbers.

gridInside

Type booleanDefault true

Specifies if grid should be drawn inside or outside the axis.

id

Type number/string

Unique id of an axis.

inside

Type booleanDefault true

Specifies if labels should be placed inside or outside the axis.

labelFrequency

Type numberDefault 1

Frequency of labels.

labelFunction

You can use this function to format axis labels. This function is called and value is passed as a attribute: labelFunction(value);

labelOffset

Type numberDefault 15

Distance from axis to the labels.

labelsEnabled

Type booleanDefault true

Specifies if labels on the axis should be shown.

listeners

Type array

You can add listeners of events using this property. Example: listeners = [{"event":"clickBand", "method":handleClick}];

minorTickInterval

Type number

Interval, at which minor ticks should be placed.

minorTickLength

Type numberDefault 5

Length of a minor tick.

radius

Type number/stringDefault 95%

Axis radius.

showFirstLabel

Type booleanDefault true

Specifies if the first label should be shown.

showLastLabel

Type booleanDefault true

Specifies if the last label should be shown.

startAngle

Type numberDefault -120

Axis start angle. Valid values are from - 180 to 180.

startValue

Type numberDefault 0

Axis start (min) value.

tickAlpha

Type numberDefault 1

Opacity of axis ticks.

tickColor

Type colorDefault #555555

Color of axis ticks.

tickLength

Type numberDefault 10

Length of a major tick.

tickThickness

Type numberDefault 1

Tick thickness.

topText

Type string

Text displayed above the axis center.

topTextBold

Type booleanDefault true

Specifies if text should be bold.

topTextColor

Type color

Color of top text.

topTextFontSize

Type number

Font size of top text.

topTextYOffset

Type numberDefault 0

Y offset of top text.

unit

Type string

A string which can be placed next to axis labels.

unitPosition

Type stringDefault right

Position of the unit.

usePrefixes

Type booleanDefault false

Specifies if small and big numbers should use prefixes to make them more readable.

valueInterval

Type number

Interval, at which ticks with values should be placed.

Methods

addListener()

Returns void

Adds event listener to the object.

type - string like 'clickBand' (should be listed in 'events' section of this class or classes which extend this class). handler - function which is called when event happens

removeListener()

Returns void

Removes event listener from chart object.

chart - chart object, type - event name, handler - method

setBottomText()

Returns void

Sets bottom text.

text - string

setTopText()

Returns void

Sets top text.

text - string

value2angle()

Returns void

Returns angle of the value.

value - Number

Events

clickBand

Param { type: "clickBand", target: GaugeAxis } & {type: "clickBand", dataItem: GaugeBand, chart: AmAngularGauge, event: MouseEvent}

Event which is fired when user clicks on gauge band.

rollOutBand

Param { type: "rollOutBand", target: GaugeAxis } & {type: "rollOutBand", dataItem: GaugeBand, chart: AmAngularGauge, event: MouseEvent}

Event which is fired when user rolls-out gauge band.

rollOverBand

Param { type: "rollOverBand", target: GaugeAxis } & {type: "rollOverBand", dataItem: GaugeBand, chart: AmAngularGauge, event: MouseEvent}

Event which is fired when user rolls-over gauge band.