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
        }
      ]
    }
  ]
});

Properties

PropertyTypeDefaultDescription
axisAlphaNumber1Axis opacity.
axisColorColor#000000Axis color.
axisThicknessNumber1Thickness of the axis outline.
bandAlphaNumber1Opacity of band fills.
bandGradientRatioArray[Number][]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.
bandOutlineAlphaNumber0Opacity of band outlines.
bandOutlineColorColor#000000Color of band outlines.
bandOutlineThicknessNumber0Thickness of band outlines.
bandsArray[GaugeBand]Array of bands - GaugeBand objects. Bands are used to draw color fills between specified values.
bottomTextStringText displayed below the axis center.
bottomTextBoldBooleantrueSpecifies if text should be bold.
bottomTextColorColorBottom text color.
bottomTextFontSizeNumberFont size of bottom text.
bottomTextYOffsetNumber0Y offset of bottom text.
centerXNumber/String0%X position of the axis, relative to the center of the gauge.
centerYNumber/String0%Y position of the axis, relative to the center of the gauge.
colorColorSpecifies labels color of the axis.
endAngleNumber120Axis end angle. Valid values are from - 180 to 180.
endValueNumberAxis end (max) value
fontSizeNumberFont size for axis labels.
gridCountNumber5Number 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.
gridInsideBooleantrueSpecifies if grid should be drawn inside or outside the axis.
idNumber/StringUnique id of an axis.
insideBooleantrueSpecifies if labels should be placed inside or outside the axis.
labelFrequencyNumber1Frequency of labels.
labelFunctionYou can use this function to format axis labels. This function is called and value is passed as a attribute: labelFunction(value);
labelOffsetNumber15Distance from axis to the labels.
labelsEnabledBooleantrueSpecifies if labels on the axis should be shown.
listenersArrayYou can add listeners of events using this property. Example: listeners = [{"event":"clickBand", "method":handleClick}];
minorTickIntervalNumberInterval, at which minor ticks should be placed.
minorTickLengthNumber5Length of a minor tick.
radiusNumber/String95%Axis radius.
showFirstLabelBooleantrueSpecifies if the first label should be shown.
showLastLabelBooleantrueSpecifies if the last label should be shown.
startAngleNumber-120Axis start angle. Valid values are from - 180 to 180.
startValueNumber0Axis start (min) value.
tickAlphaNumber1Opacity of axis ticks.
tickColorColor#555555Color of axis ticks.
tickLengthNumber10Length of a major tick.
tickThicknessNumber1Tick thickness.
topTextStringText displayed above the axis center.
topTextBoldBooleantrueSpecifies if text should be bold.
topTextColorColorColor of top text.
topTextFontSizeNumberFont size of top text.
topTextYOffsetNumber0Y offset of top text.
unitStringA string which can be placed next to axis labels.
unitPositionStringrightPosition of the unit.
usePrefixesBooleanfalseSpecifies if small and big numbers should use prefixes to make them more readable.
valueIntervalNumberInterval, at which ticks with values should be placed.

Methods

NameParametersReturnsDescription
addListener(type, handler)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 happensAdds event listener to the object.
removeListener(chart, type, handler)chart - chart object, type - event name, handler - methodRemoves event listener from chart object.
setBottomText(text)text - stringSets bottom text.
setTopText(text)text - stringSets top text.
value2angle(value)value - NumberReturns angle of the value.

Events

NameEvent objectDescription
clickBand{type: "clickBand", dataItem: GaugeBand, chart: AmAngularGauge, event: MouseEvent}Event which is fired when user clicks on gauge band.
rollOutBand{type: "rollOutBand", dataItem: GaugeBand, chart: AmAngularGauge, event: MouseEvent}Event which is fired when user rolls-out gauge band.
rollOverBand{type: "rollOverBand", dataItem: GaugeBand, chart: AmAngularGauge, event: MouseEvent}Event which is fired when user rolls-over gauge band.