Class ValueAxis

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.

Hierarchy

Index

Properties

Methods

Properties

public autoGridCount: boolean

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

default

true

public axisAlpha: number

Axis opacity. Value range is 0 - 1.

default

1

public axisColor: string

Axis color. #000000

public axisThickness: number

Thickness of the axis.

default

1

public axisTitleOffset: number

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

public baseCoord: number

Read-only. Coordinate of the base value.

public baseValue: number

Specifies base value of the axis.

public color: string

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

public dashLength: number

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

public duration: string

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

public durationUnits: Object

If duration property is set, you can specify what string should be displayed next to day, hour, minute and second. {DD:"d. ", hh:":", mm:":",ss:""}

public fillAlpha: number

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.

public fillColor: string

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. #FFFFFF

public fontSize: number

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

public gridAlpha: number

Opacity of grid lines. 0.2

public gridColor: string

Color of grid lines. #000000

public gridCount: number

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.

default

5

public gridThickness: number

Thickness of grid lines.

default

1

public gridType: string

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

public guides: Array<any>

The array of guides belonging to this axis.

public ignoreAxisWidth: boolean

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.

public includeGuidesInMinMax: boolean

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

public includeHidden: boolean

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

public inside: boolean

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

public integersOnly: boolean

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

public labelFrequency: number

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

default

1

public labelRotation: number

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

public labelsEnabled: boolean

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

default

true

public logarithmic: boolean

Specifies if this value axis' scale should be logarithmic.

public max: number

Read-only. Maximum value of the axis.

public maximum: number

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.

public min: number

Read-only. Minimum value of the axis.

public minMaxMultiplier: number

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%.

public minimum: number

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.

public offset: number

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

public position: string

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

public precision: number

Precision (number of decimals) of values.

public radarCategoriesEnabled: boolean

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

default

true

public recalculateToPercents: boolean

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

public reversed: boolean

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

public showFirstLabel: boolean

Whether to show first axis label or not.

default

true

public showLastLabel: boolean

Whether to show last axis label or not.

default

true

public stackType: string

Stacking mode of the axis. Possible values are: "none", "regular", "100%", "3d". none Note, only graphs of one type will be stacked.

public step: number

Read-only. Value difference between two grid lines.

public synchronizationMultiplier: number

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.

public tickLength: number

Length of the tick marks.

default

5

public title: string

Title of the axis.

public titleBold: boolean

Specifies if title should be bold or not.

default

true

public titleColor: string

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

public titleFontSize: number

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

public totalText: string

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.

public unit: string

Unit which will be added to the value label.

public unitPosition: string

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

public usePrefixes: boolean

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.

public useScientificNotation: boolean

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.

Methods

public addGuide(guide: Guide): any

Adds guide to the axis.

Parameters

Returns

any

public addListener(type: any, handler: any): any

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

Parameters

  • type: any
  • handler: any

Returns

any

public addListener(type: string, handler: (e: { type: string; startValue: Date; endValue: Date; chart: AmCharts.AmChart; }) => void): any

Adds event listener of the type "axisZoomed" to the object.

Parameters

  • type: string

    Always "axisZoomed".

  • handler: (e: { type: string; startValue: Date; endValue: Date; chart: AmCharts.AmChart; }) => void

    XY chart only. Dispatched when axis is zoomed.

Returns

any

public addListener(type: string, handler: (e: { type: string; chart: AmCharts.AmChart; }) => void): any

Adds event listener of the type "logarithmicAxisFailed" to the object.

Parameters

  • type: string

    Always "logarithmicAxisFailed".

  • handler: (e: { type: string; chart: AmCharts.AmChart; }) => void

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

Returns

any

public coordinateToValue(coordinate: any): any

Number, - value of coordinate. Returns value of the coordinate. coordinate - y or x coordinate, in pixels.

Parameters

  • coordinate: any

Returns

any

public getCoordinate(value: any): any

Number - coordinate Returns coordinate of the value in pixels. value - Number

Parameters

  • value: any

Returns

any

public removeGuide(guide: Guide): any

Removes guide from the axis.

Parameters

Returns

any

public removeListener(obj: any, type: any, handler: any): any

Removes event listener from the object.

Parameters

  • obj: any
  • type: any
  • handler: any

Returns

any

public removeListener(chart: AmChart, type: string, handler: any): any

Removes event listener from chart object.

Parameters

  • chart: AmChart
  • type: string
  • handler: any

Returns

any

public synchronizeWithAxis(axis: ValueAxis): any

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

Parameters

Returns

any

public zoomToValues(startValue: any, endValue: any): any

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

Parameters

  • startValue: any
  • endValue: any

Returns

any