Overview
Axes are used to plot data along the X and Y dimensions of an XY chart. amCharts 5 provides several axis types:- ValueAxis - For numeric values
- DateAxis - For date/time values
- CategoryAxis - For categorical data
- DurationAxis - For duration values
- GaplessDateAxis - Date axis without gaps
Base Axis Settings
All axes share these common settings:A renderer object which is responsible of rendering visible axis elements.See documentation
The initial relative zoom start position of the axis (0 to 1).E.g. setting it to
0.1 will pre-zoom axis to 10% from the start.See documentationThe initial relative zoom end position of the axis (0 to 1).E.g. setting it to
0.9 will pre-zoom axis to 10% from the end.See documentationMaximum number of times the scope of the axis could auto-zoom-in.This is to prevent axis jumping too drastically when scrolling/zooming.
Maximum number of axis elements to show at a time.The axis will not allow to be zoomed out beyond this number.See documentation
Minimum number of axis elements to show at a time.The axis will not allow to be zoomed in beyond this number.See documentation
Tooltip element to use for axis.
Indicates which relative place to snap to:
0 beginning, 0.5 middle, 1 end.Should tooltip snap to the
tooltipLocation (true) or follow cursor.ValueAxis
A numeric axis for plotting numeric values.ValueAxis Settings
Override minimum value for the axis scale.NOTE: the axis might modify the minimum value to fit into its scale better, unless
strictMinMax is set to true.See documentationOverride maximum value for the axis scale.NOTE: the axis might modify the maximum value to fit into its scale better, unless
strictMinMax is set to true.See documentationForce axis scale to be precisely at values as set in
min and/or max.This effectively locks the axis from auto-zooming itself when chart is zoomed in.See documentationForce axis to auto-zoom to exact lowest and highest values from attached series’ data items within currently visible range.This is a good feature when your series is plotted from derivative values.
If set to
true axis will use logarithmic scale.See documentationTreat zero values as some other value.Useful in situations where zero would result in error, i.e. logarithmic scale.See documentation
Relative extension to the automatically-calculated minimum value of the axis scale.E.g.
0.1 will extend the scale by 10%.See documentationRelative extension to the automatically-calculated maximum value of the axis scale.E.g.
0.1 will extend the scale by 10%.See documentationBase value, which indicates the threshold between “positive” and “negative” values.See documentation
Maximum number of decimals to allow in axis labels.See documentation
Number format to use for axis labels.See documentation
A numeric format used for numbers displayed in axis tooltip.See documentation
If your series relies on dynamically calculated values, like value changes, percents, or total sums, set this to
true.See documentationIf set, the grid of this axis will be synced with grid of the target axis.See documentation
DateAxis
An axis for date/time values.DateAxis Settings
Should axis group data items together dynamically?See documentation
Maximum number of data items in the view before data grouping kicks in.See documentation
Force data item grouping to specific interval.See documentation
A list of intervals the axis is allowed to group data items into.See documentation
A list of intervals the axis is allowed to show grid/labels on.See documentation
Display “period change” labels using different format.If set to
true, will use periodChangeDateFormats instead of dateFormats for such labels, e.g. for month start.Date formats used for intermediate labels.See documentation
Date formats used for “period change” labels.See documentation
A date format to use for axis tooltip.See documentation
CategoryAxis
An axis for categorical data.CategoryAxis Settings
A field in data which holds categories.
Relative location of where axis cell starts: 0 - beginning, 1 - end.
Relative location of where axis cell ends: 0 - beginning, 1 - end.
Base Axis Methods
zoom()
start and end are relative: 0 means start of the axis, 1 - end.
Relative start position (0-1)
Relative end position (0-1)
Duration of the zoom animation in milliseconds
Which end to prioritize when adjusting zoom
Animation | undefined - Zoom animation
coordinateToPosition()
Pixel coordinate
number - Relative position (0-1)
toAxisPosition()
Position (0-1)
number - Relative position
createAxisRange()
Axis data item
DataItem - Axis range