GaugeAxis

Type class

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

Example

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

Inheritance

GaugeAxis does not extend any other symbol.

GaugeAxis is not extended by any other symbol.

Properties

axisAlpha
#

Type number

Default 1

Axis opacity.

axisColor
#

Type color

Default #000000

Axis color.

axisThickness
#

Type number

Default 1

Thickness of the axis outline.

bandAlpha
#

Type number

Default 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 number

Default 0

Opacity of band outlines.

bandOutlineColor
#

Type color

Default #000000

Color of band outlines.

bandOutlineThickness
#

Type number

Default 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 boolean

Default true

Specifies if text should be bold.

bottomTextColor
#

Type color

Bottom text color.

bottomTextFontSize
#

Type number

Font size of bottom text.

bottomTextYOffset
#

Type number

Default 0

Y offset of bottom text.

centerX
#

Type number/string

Default 0%

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

centerY
#

Type number/string

Default 0%

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

color
#

Type color

Specifies labels color of the axis.

endAngle
#

Type number

Default 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 number

Default 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 boolean

Default true

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

id
#

Type number/string

Unique id of an axis.

inside
#

Type boolean

Default true

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

labelFrequency
#

Type number

Default 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 number

Default 15

Distance from axis to the labels.

labelsEnabled
#

Type boolean

Default 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 number

Default 5

Length of a minor tick.

radius
#

Type number/string

Default 95%

Axis radius.

showFirstLabel
#

Type boolean

Default true

Specifies if the first label should be shown.

showLastLabel
#

Type boolean

Default true

Specifies if the last label should be shown.

startAngle
#

Type number

Default -120

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

startValue
#

Type number

Default 0

Axis start (min) value.

tickAlpha
#

Type number

Default 1

Opacity of axis ticks.

tickColor
#

Type color

Default #555555

Color of axis ticks.

tickLength
#

Type number

Default 10

Length of a major tick.

tickThickness
#

Type number

Default 1

Tick thickness.

topText
#

Type string

Text displayed above the axis center.

topTextBold
#

Type boolean

Default true

Specifies if text should be bold.

topTextColor
#

Type color

Color of top text.

topTextFontSize
#

Type number

Font size of top text.

topTextYOffset
#

Type number

Default 0

Y offset of top text.

unit
#

Type string

A string which can be placed next to axis labels.

unitPosition
#

Type string

Default right

Position of the unit.

usePrefixes
#

Type boolean

Default 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(
  type,
  handler
)

#

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(
  chart,
  type,
  handler
)

#

Returns void

Removes event listener from chart object.

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

setBottomText(
  text
)

#

Returns void

Sets bottom text.

text - string

setTopText(
  text
)

#

Returns void

Sets top text.

text - string

value2angle(
  value
)

#

Returns void

Returns angle of the value.

value - Number

Events

#clickBand

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

Event which is fired when user clicks on gauge band.

#rollOutBand

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

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

#rollOverBand

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

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

Adapters

GaugeAxis does not have any adapters.