Information on this website refers to a deprecated product, and is provided only for historical reference. Please use the Version Switcher above to select an appropriate documentation website for the product you are using.

ValueAxis

Type class

ValueAxis is the class which displays value axis for the chart. The chart can have any number of value axes. For Serial chart one value axis is created automatically. For XY Chart two value axes (horizontal and vertical) are created automatically.

Inheritance

ValueAxis extends AxisBase.

ValueAxis is not extended by any other symbol.

Properties

axisTitleOffset
#

Type number

Default 10

Radar chart only. Specifies distance from axis to the axis title (category)

baseCoord
#

Type number

Default

Read-only. Coordinate of the base value.

baseValue
#

Type number

Default 0

Specifies base value of the axis.

duration
#

Type string

Default

If your values represents time units, and you want value axis labels to be formatted as duration, you have to set the duration unit. Possible values are: "ss", "mm", "hh" and "DD".

durationUnits
#

Type object

Default {
  DD:"d. ",
  hh:":",
  mm:":",
  ss:""
}

If duration property is set, you can specify what string should be displayed next to day, hour, minute and second.

gridType
#

Type string

Default polygons

Radar chart only. Possible values are: "polygons" and "circles". Set "circles" for polar charts.

includeGuidesInMinMax
#

Type boolean

Default false

Specifies whether guide values should be included when calculating min and max of the axis.

includeHidden
#

Type boolean

Default false

If true, the axis will include hidden graphs when calculating min and max values.

integersOnly
#

Type boolean

Default false

Specifies whether values on axis can only be integers or both integers and doubles.

labelFunction
#

Type Function

You can use this function to format Value axis labels. This function is called and these parameters are passed: labelFunction(value, valueText, valueAxis);

Where value is numeric value, valueText is formatted string and valueAxis is a reference to valueAxis object. Your function should return string.

logarithmic
#

Type boolean

Default false

Specifies if this value axis' scale should be logarithmic.

max
#

Type number

Default

Read-only. Maximum value of the axis.

maximum
#

Type number

Default

If you don't want max value to be calculated by the chart, set it using this property. This value might still be adjusted so that it would be possible to draw grid at rounded intervals.

min
#

Type number

Default

Read-only. Minimum value of the axis.

minimum
#

Type number

Default

If you don't want min value to be calculated by the chart, set it using this property. This value might still be adjusted so that it would be possible to draw grid at rounded intervals.

minMaxMultiplier
#

Type number

Default

If set value axis scale (min and max numbers) will be multiplied by it. I.e. if set to 1.2 the scope of values will increase by 20%.

precision
#

Type number

Default

Precision (number of decimals) of values.

radarCategoriesEnabled
#

Type boolean

Default true

Radar chart only. Specifies if categories (axes' titles) should be displayed near axes)

recalculateToPercents
#

Type boolean

Default false

pecifies if graphs's values should be recalculated to percents.

reversed
#

Type boolean

Default false

Specifies if value axis should be reversed (smaller values on top).

stackType
#

Type string

Default none

Stacking mode of the axis. Possible values are: "none", "regular", "100%", "3d".

Note, only graphs of one type will be stacked.

step
#

Type number

Default

Read-only. Value difference between two grid lines.

synchronizationMultiplier
#

Type number

Default

In case you synchronize one value axis with another, you need to set the synchronization multiplier. Use synchronizeWithAxis method to set with which axis it should be synced.

totalText
#

Type string

Default

If this value axis is stacked and has columns, setting valueAxis.totalText = "[[total]]" will make it to display total value above the most-top column.

totalTextColor
#

Type Hex string

Color of total text.

unit
#

Type string

Default

Unit which will be added to the value label.

unitPosition
#

Type string

Default right

Position of the unit. Possible values are "left" and "right".

usePrefixes
#

Type boolean

Default false

If true, prefixes will be used for big and small numbers. You can set arrays of prefixes directly to the chart object via prefixesOfSmallNumbers and prefixesOfBigNumbers.

useScientificNotation
#

Type boolean

Default false

If true, values will always be formatted using scientific notation (5e+8, 5e-8...) Otherwise only values bigger then 1e+21 and smaller then 1e-7 will be displayed in scientific notation.

autoGridCount
#

Type boolean

Default true

Inherited from AxisBase

Specifies whether number of gridCount is specified automatically, acoarding to the axis size.

axisAlpha
#

Type number

Default 1

Inherited from AxisBase

Axis opacity. Value range is 0 - 1.

axisColor
#

Type string

Default #000000

Inherited from AxisBase

Axis color.

axisThickness
#

Type number

Default 1

Inherited from AxisBase

Thickness of the axis.

color
#

Type string

Default

Inherited from AxisBase

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

dashLength
#

Type number

Default 0

Inherited from AxisBase

Length of a dash. 0 means line is not dashed.

fillAlpha
#

Type number

Default 0

Inherited from AxisBase

Fill opacity. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.

fillColor
#

Type string

Default #FFFFFF

Inherited from AxisBase

Fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.

fontSize
#

Type number

Default

Inherited from AxisBase

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

gridAlpha
#

Type number

Default 0.2

Inherited from AxisBase

Opacity of grid lines.

gridColor
#

Type string

Default #000000

Inherited from AxisBase

Color of grid lines.

gridCount
#

Type number

Default 5

Inherited from AxisBase

Number of grid lines. In case this is value axis, or your categoryAxis parses dates, the number is approximate. The default value is 5. If you set autoGridCount to true, this property is ignored.

gridThickness
#

Type number

Default 1

Inherited from AxisBase

Thickness of grid lines.

guides
#

Type array

Default

Inherited from AxisBase

The array of guides belonging to this axis.

ignoreAxisWidth
#

Type boolean

Default false

Inherited from AxisBase

If autoMargins of a chart is set to true, but you want this axis not to be measured when calculating margin, set ignoreAxisWidth to true.

inside
#

Type boolean

Default false

Inherited from AxisBase

Specifies whether values should be placed inside or outside plot area.

labelFrequency
#

Type number

Default 1

Inherited from AxisBase

Frequency at which labels should be placed. Doesn't work for CategoryAxis if parseDates is set to true.

labelRotation
#

Type number

Default 0

Inherited from AxisBase

Rotation angle of a label. Only horizontal axis' values can be rotated. If you set this for vertical axis, the setting will be ignored.

labelsEnabled
#

Type boolean

Default true

Inherited from AxisBase

Specifies whether axis displays category axis' labels and value axis' values.

offset
#

Type number

Default 0

Inherited from AxisBase

The distance of the axis to the plot area, in pixels. Negative values can also be used.

position
#

Type string

Default

Inherited from AxisBase

Possible values are: "top", "bottom", "left", "right". If axis is vertical, default position is "left". If axis is horizontal, default position is "bottom".

showFirstLabel
#

Type boolean

Default true

Inherited from AxisBase

Whether to show first axis label or not.

showLastLabel
#

Type boolean

Default true

Inherited from AxisBase

Whether to show last axis label or not.

tickLength
#

Type number

Default 5

Inherited from AxisBase

Length of the tick marks.

title
#

Type string

Default

Inherited from AxisBase

Title of the axis.

titleBold
#

Type boolean

Default true

Inherited from AxisBase

Specifies if title should be bold or not.

titleColor
#

Type string

Default

Inherited from AxisBase

Color of axis title. Will use text color of chart if not set any.

titleFontSize
#

Type number

Default

Inherited from AxisBase

Font size of axis title. Will use font size of chart plus two pixels if not set any.

There are 28 inherited items currently hidden from this list.

Methods

addGuide(
  guide
)

#

Returns void

Inherited from AxisBase

Adds guide to the axis.

guide - instance of Guide

addListener(
  type,
  handler
)

#

Returns

Adds event listener to the object.

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

coordinateToValue(
  coordinate
)

#

Returns Number, - value of coordinate.

Returns value of the coordinate.

coordinate - y or x coordinate, in pixels.

getCoordinate(
  value
)

#

Returns Number - coordinate

Returns coordinate of the value in pixels.

value - Number

removeGuide(
  guide
)

#

Returns void

Inherited from AxisBase

Removes guide from the axis.

guide - instance of Guide

removeListener(
  obj,
  type,
  handler
)

#

Returns

Removes event listener from the object

synchronizeWithAxis(
  axis
)

#

Returns

One value axis can be synchronized with another value axis. You should set synchronizationMultiplyer in order for this to work.

axis - instance of ValueAxis.

zoomToValues(
  startValue,
  endValue
)

#

Returns

XY Chart only. Zooms-in the axis to the provided values.

There are 2 inherited items currently hidden from this list.

Events

#axisChanged

Param {type:"axisChanged", chart:AmChart}

Dispatched when value axis min/max values are changed.

#axisZoomed

Param {type:"axisZoomed", startValue:startValue, endValue:endValue, chart:AmChart}

XY chart only. Dispatched when axis is zoomed.

#logarithmicAxisFailed

Param {type:"logarithmicAxisFailed", chart:AmChart}

Dispatched when valueAxis is logarithmic and values equal or less then zero were found in data.

Adapters

ValueAxis does not have any adapters.