highcharts
Version:
JavaScript charting framework
1,368 lines (1,278 loc) • 215 kB
JavaScript
/**
* (c) 2010-2018 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/**
* Options for crosshairs on axes.
*
* @typedef {Highcharts.XAxisCrosshairOptions|Highcharts.YAxisCrosshairOptions} Highcharts.AxisCrosshairOptions
*/
/**
* Options for axes.
*
* @typedef {Highcharts.XAxisOptions|Highcharts.YAxisOptions|Highcharts.ZAxisOptions} Highcharts.AxisOptions
*/
/**
* Position of the axis title.
*
* @typedef Highcharts.AxisTitlePositionObject
*
* @property {number} x
* X position.
*
* @property {number} y
* Y position.
*/
/**
* The returned object literal from the {@link Highcharts.Axis#getExtremes}
* function.
*
* @typedef Highcharts.ExtremesObject
*
* @property {number} dataMax
* The maximum value of the axis' associated series.
*
* @property {number} dataMin
* The minimum value of the axis' associated series.
*
* @property {number} max
* The maximum axis value, either automatic or set manually. If
* the `max` option is not set, `maxPadding` is 0 and `endOnTick`
* is false, this value will be the same as `dataMax`.
*
* @property {number} min
* The minimum axis value, either automatic or set manually. If
* the `min` option is not set, `minPadding` is 0 and
* `startOnTick` is false, this value will be the same
* as `dataMin`.
*
* @property {number} userMax
* The user defined maximum, either from the `max` option or from
* a zoom or `setExtremes` action.
*
* @property {number} userMin
* The user defined minimum, either from the `min` option or from
* a zoom or `setExtremes` action.
*/
'use strict';
import H from './Globals.js';
import './Utilities.js';
import './Color.js';
import './Options.js';
import './Tick.js';
var addEvent = H.addEvent,
animObject = H.animObject,
arrayMax = H.arrayMax,
arrayMin = H.arrayMin,
color = H.color,
correctFloat = H.correctFloat,
defaultOptions = H.defaultOptions,
defined = H.defined,
deg2rad = H.deg2rad,
destroyObjectProperties = H.destroyObjectProperties,
each = H.each,
extend = H.extend,
fireEvent = H.fireEvent,
format = H.format,
getMagnitude = H.getMagnitude,
grep = H.grep,
inArray = H.inArray,
isArray = H.isArray,
isNumber = H.isNumber,
isString = H.isString,
merge = H.merge,
normalizeTickInterval = H.normalizeTickInterval,
objectEach = H.objectEach,
pick = H.pick,
removeEvent = H.removeEvent,
splat = H.splat,
syncTimeout = H.syncTimeout,
Tick = H.Tick;
/**
* Create a new axis object. Called internally when instanciating a new chart or
* adding axes by {@link Highcharts.Chart#addAxis}.
*
* A chart can have from 0 axes (pie chart) to multiples. In a normal, single
* series cartesian chart, there is one X axis and one Y axis.
*
* The X axis or axes are referenced by {@link Highcharts.Chart.xAxis}, which is
* an array of Axis objects. If there is only one axis, it can be referenced
* through `chart.xAxis[0]`, and multiple axes have increasing indices. The same
* pattern goes for Y axes.
*
* If you need to get the axes from a series object, use the `series.xAxis` and
* `series.yAxis` properties. These are not arrays, as one series can only be
* associated to one X and one Y axis.
*
* A third way to reference the axis programmatically is by `id`. Add an `id` in
* the axis configuration options, and get the axis by
* {@link Highcharts.Chart#get}.
*
* Configuration options for the axes are given in options.xAxis and
* options.yAxis.
*
* @class
* @name Highcharts.Axis
*
* @param {Highcharts.Chart} chart
* The Chart instance to apply the axis on.
*
* @param {Highcharts.AxisOptions} options
* Axis options.
*/
var Axis = function () {
this.init.apply(this, arguments);
};
H.extend(Axis.prototype, /** @lends Highcharts.Axis.prototype */{
/**
* The X axis or category axis. Normally this is the horizontal axis,
* though if the chart is inverted this is the vertical axis. In case of
* multiple axes, the xAxis node is an array of configuration objects.
*
* See [the Axis object](/class-reference/Highcharts.Axis) for
* programmatic access to the axis.
*
* @productdesc {highmaps}
* In Highmaps, the axis is hidden, but it is used behind the scenes to
* control features like zooming and panning. Zooming is in effect the same
* as setting the extremes of one of the exes.
*
* @optionparent xAxis
*/
defaultOptions: {
/**
* When using multiple axis, the ticks of two or more opposite axes
* will automatically be aligned by adding ticks to the axis or axes
* with the least ticks, as if `tickAmount` were specified.
*
* This can be prevented by setting `alignTicks` to false. If the grid
* lines look messy, it's a good idea to hide them for the secondary
* axis by setting `gridLineWidth` to 0.
*
* If `startOnTick` or `endOnTick` in an Axis options are set to false,
* then the `alignTicks ` will be disabled for the Axis.
*
* Disabled for logarithmic axes.
*
* @type {boolean}
* @default true
* @product highcharts highstock gantt
* @apioption xAxis.alignTicks
*/
/**
* Whether to allow decimals in this axis' ticks. When counting
* integers, like persons or hits on a web page, decimals should
* be avoided in the labels.
*
* @see [minTickInterval](#xAxis.minTickInterval)
*
* @sample {highcharts|highstock} highcharts/yaxis/allowdecimals-true/
* True by default
* @sample {highcharts|highstock} highcharts/yaxis/allowdecimals-false/
* False
*
* @type {boolean}
* @default true
* @since 2.0
* @apioption xAxis.allowDecimals
*/
/**
* When using an alternate grid color, a band is painted across the
* plot area between every other grid line.
*
* @sample {highcharts} highcharts/yaxis/alternategridcolor/
* Alternate grid color on the Y axis
* @sample {highstock} stock/xaxis/alternategridcolor/
* Alternate grid color on the Y axis
*
* @type {Highcharts.ColorString}
* @apioption xAxis.alternateGridColor
*/
/**
* An array defining breaks in the axis, the sections defined will be
* left out and all the points shifted closer to each other.
*
* @productdesc {highcharts}
* Requires that the broken-axis.js module is loaded.
*
* @sample {highcharts} highcharts/axisbreak/break-simple/
* Simple break
* @sample {highcharts|highstock} highcharts/axisbreak/break-visualized/
* Advanced with callback
* @sample {highstock} stock/demo/intraday-breaks/
* Break on nights and weekends
*
* @type {Array<*>}
* @since 4.1.0
* @product highcharts highstock gantt
* @apioption xAxis.breaks
*/
/**
* A number indicating how much space should be left between the start
* and the end of the break. The break size is given in axis units,
* so for instance on a `datetime` axis, a break size of 3600000 would
* indicate the equivalent of an hour.
*
* @type {number}
* @default 0
* @since 4.1.0
* @product highcharts highstock gantt
* @apioption xAxis.breaks.breakSize
*/
/**
* The point where the break starts.
*
* @type {number}
* @since 4.1.0
* @product highcharts highstock gantt
* @apioption xAxis.breaks.from
*/
/**
* Defines an interval after which the break appears again. By default
* the breaks do not repeat.
*
* @type {number}
* @default 0
* @since 4.1.0
* @product highcharts highstock gantt
* @apioption xAxis.breaks.repeat
*/
/**
* The point where the break ends.
*
* @type {number}
* @since 4.1.0
* @product highcharts highstock gantt
* @apioption xAxis.breaks.to
*/
/**
* If categories are present for the xAxis, names are used instead of
* numbers for that axis. Since Highcharts 3.0, categories can also
* be extracted by giving each point a [name](#series.data) and setting
* axis [type](#xAxis.type) to `category`. However, if you have multiple
* series, best practice remains defining the `categories` array.
*
* Example:
*
* <pre>categories: ['Apples', 'Bananas', 'Oranges']</pre>
*
* @sample {highcharts} highcharts/demo/line-labels/
* With
* @sample {highcharts} highcharts/xaxis/categories/
* Without
*
* @type {Array<string>}
* @product highcharts
* @apioption xAxis.categories
*/
/**
* The highest allowed value for automatically computed axis extremes.
*
* @see [floor](#xAxis.floor)
*
* @sample {highcharts|highstock} highcharts/yaxis/floor-ceiling/
* Floor and ceiling
*
* @type {number}
* @since 4.0
* @product highcharts highstock gantt
* @apioption xAxis.ceiling
*/
/**
* A class name that opens for styling the axis by CSS, especially in
* Highcharts styled mode. The class name is applied to group elements
* for the grid, axis elements and labels.
*
* @sample {highcharts|highstock|highmaps} highcharts/css/axis/
* Multiple axes with separate styling
*
* @type {string}
* @since 5.0.0
* @apioption xAxis.className
*/
/**
* Configure a crosshair that follows either the mouse pointer or the
* hovered point.
*
* In styled mode, the crosshairs are styled in the
* `.highcharts-crosshair`, `.highcharts-crosshair-thin` or
* `.highcharts-xaxis-category` classes.
*
* @productdesc {highstock}
* In Highstock, by default, the crosshair is enabled on the X axis and
* disabled on the Y axis.
*
* @sample {highcharts} highcharts/xaxis/crosshair-both/
* Crosshair on both axes
* @sample {highstock} stock/xaxis/crosshairs-xy/
* Crosshair on both axes
* @sample {highmaps} highcharts/xaxis/crosshair-both/
* Crosshair on both axes
*
* @type {boolean|*}
* @default false
* @since 4.1
* @apioption xAxis.crosshair
*/
/**
* A class name for the crosshair, especially as a hook for styling.
*
* @type {string}
* @since 5.0.0
* @apioption xAxis.crosshair.className
*/
/**
* The color of the crosshair. Defaults to `#cccccc` for numeric and
* datetime axes, and `rgba(204,214,235,0.25)` for category axes, where
* the crosshair by default highlights the whole category.
*
* @sample {highcharts|highstock|highmaps} highcharts/xaxis/crosshair-customized/
* Customized crosshairs
*
* @type {Highcharts.ColorString}
* @default #cccccc
* @since 4.1
* @apioption xAxis.crosshair.color
*/
/**
* The dash style for the crosshair. See
* [series.dashStyle](#plotOptions.series.dashStyle)
* for possible values.
*
* @sample {highcharts|highmaps} highcharts/xaxis/crosshair-dotted/
* Dotted crosshair
* @sample {highstock} stock/xaxis/crosshair-dashed/
* Dashed X axis crosshair
*
* @type {string}
* @default Solid
* @since 4.1
* @validvalue ["Solid", "ShortDash", "ShortDot", "ShortDashDot",
* "ShortDashDotDot", "Dot", "Dash" ,"LongDash", "DashDot",
* "LongDashDot", "LongDashDotDot"]
* @apioption xAxis.crosshair.dashStyle
*/
/**
* A label on the axis next to the crosshair.
*
* In styled mode, the label is styled with the
* `.highcharts-crosshair-label` class.
*
* @sample {highstock} stock/xaxis/crosshair-label/
* Crosshair labels
* @sample {highstock} highcharts/css/crosshair-label/
* Style mode
*
* @since 2.1
* @product highstock
* @apioption xAxis.crosshair.label
*/
/**
* Alignment of the label compared to the axis. Defaults to `left` for
* right-side axes, `right` for left-side axes and `center` for
* horizontal axes.
*
* @type {string}
* @since 2.1
* @product highstock
* @apioption xAxis.crosshair.label.align
*/
/**
* The background color for the label. Defaults to the related series
* color, or `#666666` if that is not available.
*
* @type {Highcharts.ColorString}
* @since 2.1
* @product highstock
* @apioption xAxis.crosshair.label.backgroundColor
*/
/**
* The border color for the crosshair label
*
* @type {Highcharts.ColorString}
* @since 2.1
* @product highstock
* @apioption xAxis.crosshair.label.borderColor
*/
/**
* The border corner radius of the crosshair label.
*
* @type {number}
* @default 3
* @since 2.1.10
* @product highstock
* @apioption xAxis.crosshair.label.borderRadius
*/
/**
* The border width for the crosshair label.
*
* @type {number}
* @default 0
* @since 2.1
* @product highstock
* @apioption xAxis.crosshair.label.borderWidth
*/
/**
* A format string for the crosshair label. Defaults to `{value}` for
* numeric axes and `{value:%b %d, %Y}` for datetime axes.
*
* @type {string}
* @since 2.1
* @product highstock
* @apioption xAxis.crosshair.label.format
*/
/**
* Formatter function for the label text.
*
* @type {Highcharts.FormatterCallbackFunction}
* @since 2.1
* @product highstock
* @apioption xAxis.crosshair.label.formatter
*/
/**
* Padding inside the crosshair label.
*
* @type {number}
* @default 8
* @since 2.1
* @product highstock
* @apioption xAxis.crosshair.label.padding
*/
/**
* The shape to use for the label box.
*
* @type {string}
* @default callout
* @since 2.1
* @product highstock
* @apioption xAxis.crosshair.label.shape
*/
/**
* Text styles for the crosshair label.
*
* @type {Highcharts.CSSObject}
* @default {"color": "white", "fontWeight": "normal", "fontSize": "11px", "textAlign": "center"}
* @since 2.1
* @product highstock
* @apioption xAxis.crosshair.label.style
*/
/**
* Whether the crosshair should snap to the point or follow the pointer
* independent of points.
*
* @sample {highcharts|highstock} highcharts/xaxis/crosshair-snap-false/
* True by default
* @sample {highmaps} maps/demo/latlon-advanced/
* Snap is false
*
* @type {boolean}
* @default true
* @since 4.1
* @apioption xAxis.crosshair.snap
*/
/**
* The pixel width of the crosshair. Defaults to 1 for numeric or
* datetime axes, and for one category width for category axes.
*
* @sample {highcharts} highcharts/xaxis/crosshair-customized/
* Customized crosshairs
* @sample {highstock} highcharts/xaxis/crosshair-customized/
* Customized crosshairs
* @sample {highmaps} highcharts/xaxis/crosshair-customized/
* Customized crosshairs
*
* @type {number}
* @default 1
* @since 4.1
* @apioption xAxis.crosshair.width
*/
/**
* The Z index of the crosshair. Higher Z indices allow drawing the
* crosshair on top of the series or behind the grid lines.
*
* @type {number}
* @default 2
* @since 4.1
* @apioption xAxis.crosshair.zIndex
*/
/**
* For a datetime axis, the scale will automatically adjust to the
* appropriate unit. This member gives the default string
* representations used for each unit. For intermediate values,
* different units may be used, for example the `day` unit can be used
* on midnight and `hour` unit be used for intermediate values on the
* same axis. For an overview of the replacement codes, see
* [dateFormat](/class-reference/Highcharts#dateFormat). Defaults to:
*
* <pre>{
* millisecond: '%H:%M:%S.%L',
* second: '%H:%M:%S',
* minute: '%H:%M',
* hour: '%H:%M',
* day: '%e. %b',
* week: '%e. %b',
* month: '%b \'%y',
* year: '%Y'
* }</pre>
*
* @sample {highcharts} highcharts/xaxis/datetimelabelformats/
* Different day format on X axis
* @sample {highstock} stock/xaxis/datetimelabelformats/
* More information in x axis labels
*
* @product highcharts highstock gantt
*/
dateTimeLabelFormats: {
millisecond: {
main: '%H:%M:%S.%L',
range: false
},
second: {
main: '%H:%M:%S',
range: false
},
minute: {
main: '%H:%M',
range: false
},
hour: {
main: '%H:%M',
range: false
},
day: {
main: '%e. %b'
},
week: {
main: '%e. %b'
},
month: {
main: '%b \'%y'
},
year: {
main: '%Y'
}
},
/**
* _Requires Accessibility module_
*
* Description of the axis to screen reader users.
*
* @type {string}
* @since 5.0.0
* @apioption xAxis.description
*/
/**
* Whether to force the axis to end on a tick. Use this option with
* the `maxPadding` option to control the axis end.
*
* @productdesc {highstock}
* In Highstock, `endOnTick` is always false when the navigator is
* enabled, to prevent jumpy scrolling.
*
* @sample {highcharts} highcharts/chart/reflow-true/
* True by default
* @sample {highcharts} highcharts/yaxis/endontick/
* False
* @sample {highstock} stock/demo/basic-line/
* True by default
* @sample {highstock} stock/xaxis/endontick/
* False
*
* @since 1.2.0
*/
endOnTick: false,
/**
* Event handlers for the axis.
*
* @type {*}
* @apioption xAxis.events
*/
/**
* An event fired after the breaks have rendered.
*
* @see [breaks](#xAxis.breaks)
*
* @sample {highcharts} highcharts/axisbreak/break-event/
* AfterBreak Event
*
* @type {Function}
* @since 4.1.0
* @product highcharts gantt
* @apioption xAxis.events.afterBreaks
*/
/**
* As opposed to the `setExtremes` event, this event fires after the
* final min and max values are computed and corrected for `minRange`.
*
*
* Fires when the minimum and maximum is set for the axis, either by
* calling the `.setExtremes()` method or by selecting an area in the
* chart. One parameter, `event`, is passed to the function, containing
* common event information.
*
* The new user set minimum and maximum values can be found by
* `event.min` and `event.max`. These reflect the axis minimum and
* maximum in axis values. The actual data extremes are found in
* `event.dataMin` and `event.dataMax`.
*
* @type {Function}
* @since 2.3
* @context Axis
* @apioption xAxis.events.afterSetExtremes
*/
/**
* An event fired when a break from this axis occurs on a point.
*
* @see [breaks](#xAxis.breaks)
*
* @sample {highcharts} highcharts/axisbreak/break-visualized/
* Visualization of a Break
*
* @type {Function}
* @since 4.1.0
* @product highcharts gantt
* @context Axis
* @apioption xAxis.events.pointBreak
*/
/**
* An event fired when a point falls inside a break from this axis.
*
* @type {Function}
* @product highcharts highstock gantt
* @context Axis
* @apioption xAxis.events.pointInBreak
*/
/**
* Fires when the minimum and maximum is set for the axis, either by
* calling the `.setExtremes()` method or by selecting an area in the
* chart. One parameter, `event`, is passed to the function,
* containing common event information.
*
* The new user set minimum and maximum values can be found by
* `event.min` and `event.max`. These reflect the axis minimum and
* maximum in data values. When an axis is zoomed all the way out from
* the "Reset zoom" button, `event.min` and `event.max` are null, and
* the new extremes are set based on `this.dataMin` and `this.dataMax`.
*
* @sample {highstock} stock/xaxis/events-setextremes/
* Log new extremes on x axis
*
* @type {Function}
* @since 1.2.0
* @context Axis
* @apioption xAxis.events.setExtremes
*/
/**
* The lowest allowed value for automatically computed axis extremes.
*
* @see [ceiling](#yAxis.ceiling)
*
* @sample {highcharts} highcharts/yaxis/floor-ceiling/
* Floor and ceiling
* @sample {highstock} stock/demo/lazy-loading/
* Prevent negative stock price on Y axis
*
* @type {number}
* @since 4.0
* @product highcharts highstock gantt
* @apioption xAxis.floor
*/
/**
* The dash or dot style of the grid lines. For possible values, see
* [this demonstration](https://jsfiddle.net/gh/get/library/pure/
* highcharts/highcharts/tree/master/samples/highcharts/plotoptions/
* series-dashstyle-all/).
*
* @sample {highcharts} highcharts/yaxis/gridlinedashstyle/
* Long dashes
* @sample {highstock} stock/xaxis/gridlinedashstyle/
* Long dashes
*
* @type {string}
* @default Solid
* @since 1.2
* @validvalue ["Solid", "ShortDash", "ShortDot", "ShortDashDot",
* "ShortDashDotDot", "Dot", "Dash" ,"LongDash", "DashDot",
* "LongDashDot", "LongDashDotDot"]
* @apioption xAxis.gridLineDashStyle
*/
/**
* The Z index of the grid lines.
*
* @sample {highcharts|highstock} highcharts/xaxis/gridzindex/
* A Z index of 4 renders the grid above the graph
*
* @type {number}
* @default 1
* @product highcharts highstock gantt
* @apioption xAxis.gridZIndex
*/
/**
* An id for the axis. This can be used after render time to get
* a pointer to the axis object through `chart.get()`.
*
* @sample {highcharts} highcharts/xaxis/id/
* Get the object
* @sample {highstock} stock/xaxis/id/
* Get the object
*
* @type {string}
* @since 1.2.0
* @apioption xAxis.id
*/
/**
* The axis labels show the number or category for each tick.
*
* @productdesc {highmaps}
* X and Y axis labels are by default disabled in Highmaps, but the
* functionality is inherited from Highcharts and used on `colorAxis`,
* and can be enabled on X and Y axes too.
*/
labels: {
/**
* What part of the string the given position is anchored to.
* If `left`, the left side of the string is at the axis position.
* Can be one of `"left"`, `"center"` or `"right"`. Defaults to
* an intelligent guess based on which side of the chart the axis
* is on and the rotation of the label.
*
* @see [reserveSpace](#xAxis.labels.reserveSpace)
*
* @sample {highcharts} highcharts/xaxis/labels-align-left/
* Left
* @sample {highcharts} highcharts/xaxis/labels-align-right/
* Right
* @sample {highcharts} highcharts/xaxis/labels-reservespace-true/
* Left-aligned labels on a vertical category axis
*
* @type {string}
* @validvalue ["left", "center", "right"]
* @apioption xAxis.labels.align
*/
/**
* For horizontal axes, the allowed degrees of label rotation
* to prevent overlapping labels. If there is enough space,
* labels are not rotated. As the chart gets narrower, it
* will start rotating the labels -45 degrees, then remove
* every second label and try again with rotations 0 and -45 etc.
* Set it to `false` to disable rotation, which will
* cause the labels to word-wrap if possible.
*
* @sample {highcharts|highstock} highcharts/xaxis/labels-autorotation-default/
* Default auto rotation of 0 or -45
* @sample {highcharts|highstock} highcharts/xaxis/labels-autorotation-0-90/
* Custom graded auto rotation
*
* @type {Array<number>}
* @default [-45]
* @since 4.1.0
* @product highcharts highstock gantt
* @apioption xAxis.labels.autoRotation
*/
/**
* When each category width is more than this many pixels, we don't
* apply auto rotation. Instead, we lay out the axis label with word
* wrap. A lower limit makes sense when the label contains multiple
* short words that don't extend the available horizontal space for
* each label.
*
* @sample {highcharts} highcharts/xaxis/labels-autorotationlimit/
* Lower limit
*
* @type {number}
* @default 80
* @since 4.1.5
* @product highcharts gantt
* @apioption xAxis.labels.autoRotationLimit
*/
/**
* Polar charts only. The label's pixel distance from the perimeter
* of the plot area.
*
* @type {number}
* @default 15
* @product highcharts gantt
* @apioption xAxis.labels.distance
*/
/**
* Enable or disable the axis labels.
*
* @sample {highcharts} highcharts/xaxis/labels-enabled/
* X axis labels disabled
* @sample {highstock} stock/xaxis/labels-enabled/
* X axis labels disabled
*
* @default {highcharts|highstock|gantt} true
* @default {highmaps} false
*/
enabled: true,
/**
* A [format string](https://www.highcharts.com/docs/chart-
* concepts/labels-and-string-formatting) for the axis label.
*
* @sample {highcharts|highstock} highcharts/yaxis/labels-format/
* Add units to Y axis label
*
* @type {string}
* @default {value}
* @since 3.0
* @apioption xAxis.labels.format
*/
/**
* Callback JavaScript function to format the label. The value
* is given by `this.value`. Additional properties for `this` are
* `axis`, `chart`, `isFirst` and `isLast`. The value of the default
* label formatter can be retrieved by calling
* `this.axis.defaultLabelFormatter.call(this)` within the function.
*
* Defaults to:
*
* <pre>function() {
* return this.value;
* }</pre>
*
* @sample {highcharts} highcharts/xaxis/labels-formatter-linked/
* Linked category names
* @sample {highcharts} highcharts/xaxis/labels-formatter-extended/
* Modified numeric labels
* @sample {highstock} stock/xaxis/labels-formatter/
* Added units on Y axis
*
* @type {Function}
* @apioption xAxis.labels.formatter
*/
/**
* The number of pixels to indent the labels per level in a treegrid
* axis.
*
* @product gantt
* @sample gantt/treegrid-axis/demo
* Indentation 10px by default.
* @sample gantt/treegrid-axis/indentation-0px
* Indentation set to 0px.
*/
indentation: 10,
/**
* Horizontal axis only. When `staggerLines` is not set,
* `maxStaggerLines` defines how many lines the axis is allowed to
* add to automatically avoid overlapping X labels. Set to `1` to
* disable overlap detection.
*
* @deprecated
* @type {number}
* @default 5
* @since 1.3.3
* @apioption xAxis.labels.maxStaggerLines
*/
/**
* How to handle overflowing labels on horizontal axis. If set to
* `"allow"`, it will not be aligned at all. By default it
* `"justify"` labels inside the chart area. If there is room to
* move it, it will be aligned to the edge, else it will be removed.
*
* @type {boolean|string}
* @default justify
* @since 2.2.5
* @validvalue ["allow", "justify"]
* @apioption xAxis.labels.overflow
*/
/**
* The pixel padding for axis labels, to ensure white space between
* them.
*
* @type {number}
* @default 5
* @product highcharts gantt
* @apioption xAxis.labels.padding
*/
/**
* Whether to reserve space for the labels. By default, space is
* reserved for the labels in these cases:
*
* * On all horizontal axes.
* * On vertical axes if `label.align` is `right` on a left-side
* axis or `left` on a right-side axis.
* * On vertical axes if `label.align` is `center`.
*
* This can be turned off when for example the labels are rendered
* inside the plot area instead of outside.
*
* @see [labels.align](#xAxis.labels.align)
*
* @sample {highcharts} highcharts/xaxis/labels-reservespace/
* No reserved space, labels inside plot
* @sample {highcharts} highcharts/xaxis/labels-reservespace-true/
* Left-aligned labels on a vertical category axis
*
* @type {boolean}
* @since 4.1.10
* @product highcharts gantt
* @apioption xAxis.labels.reserveSpace
*/
/**
* Rotation of the labels in degrees.
*
* @sample {highcharts} highcharts/xaxis/labels-rotation/
* X axis labels rotated 90°
*
* @type {number}
* @default 0
* @apioption xAxis.labels.rotation
*/
/**
* Horizontal axes only. The number of lines to spread the labels
* over to make room or tighter labels.
*
* @sample {highcharts} highcharts/xaxis/labels-staggerlines/
* Show labels over two lines
* @sample {highstock} stock/xaxis/labels-staggerlines/
* Show labels over two lines
*
* @type {number}
* @since 2.1
* @apioption xAxis.labels.staggerLines
*/
/**
* To show only every _n_'th label on the axis, set the step to _n_.
* Setting the step to 2 shows every other label.
*
* By default, the step is calculated automatically to avoid
* overlap. To prevent this, set it to 1\. This usually only
* happens on a category axis, and is often a sign that you have
* chosen the wrong axis type.
*
* Read more at
* [Axis docs](https://www.highcharts.com/docs/chart-concepts/axes)
* => What axis should I use?
*
* @sample {highcharts} highcharts/xaxis/labels-step/
* Showing only every other axis label on a categorized
* x-axis
* @sample {highcharts} highcharts/xaxis/labels-step-auto/
* Auto steps on a category axis
*
* @type {number}
* @since 2.1
* @apioption xAxis.labels.step
*/
/**
* Whether to [use HTML](https://www.highcharts.com/docs/chart-
* concepts/labels-and-string-formatting#html) to render the labels.
*
* @type {boolean}
* @default false
* @apioption xAxis.labels.useHTML
*/
/**
* The x position offset of the label relative to the tick position
* on the axis.
*
* @sample {highcharts} highcharts/xaxis/labels-x/
* Y axis labels placed on grid lines
*/
x: 0,
/**
* The y position offset of the label relative to the tick position
* on the axis. The default makes it adapt to the font size on
* bottom axis.
*
* @sample {highcharts} highcharts/xaxis/labels-x/
* Y axis labels placed on grid lines
*
* @type {number}
* @apioption xAxis.labels.y
*/
/**
* The Z index for the axis labels.
*
* @type {number}
* @default 7
* @apioption xAxis.labels.zIndex
*/
},
/**
* Index of another axis that this axis is linked to. When an axis is
* linked to a master axis, it will take the same extremes as
* the master, but as assigned by min or max or by setExtremes.
* It can be used to show additional info, or to ease reading the
* chart by duplicating the scales.
*
* @sample {highcharts} highcharts/xaxis/linkedto/
* Different string formats of the same date
* @sample {highcharts} highcharts/yaxis/linkedto/
* Y values on both sides
*
* @type {number}
* @since 2.0.2
* @product highcharts highstock gantt
* @apioption xAxis.linkedTo
*/
/**
* The maximum value of the axis. If `null`, the max value is
* automatically calculated.
*
* If the [endOnTick](#yAxis.endOnTick) option is true, the `max` value
* might be rounded up.
*
* If a [tickAmount](#yAxis.tickAmount) is set, the axis may be extended
* beyond the set max in order to reach the given number of ticks. The
* same may happen in a chart with multiple axes, determined by [chart.
* alignTicks](#chart), where a `tickAmount` is applied internally.
*
* @sample {highcharts} highcharts/yaxis/max-200/
* Y axis max of 200
* @sample {highcharts} highcharts/yaxis/max-logarithmic/
* Y axis max on logarithmic axis
* @sample {highstock} stock/xaxis/min-max/
* Fixed min and max on X axis
* @sample {highmaps} maps/axis/min-max/
* Pre-zoomed to a specific area
*
* @type {number}
* @apioption xAxis.max
*/
/**
* Padding of the max value relative to the length of the axis. A
* padding of 0.05 will make a 100px axis 5px longer. This is useful
* when you don't want the highest data value to appear on the edge
* of the plot area. When the axis' `max` option is set or a max extreme
* is set using `axis.setExtremes()`, the maxPadding will be ignored.
*
* @sample {highcharts} highcharts/yaxis/maxpadding/
* Max padding of 0.25 on y axis
* @sample {highstock} stock/xaxis/minpadding-maxpadding/
* Greater min- and maxPadding
* @sample {highmaps} maps/chart/plotbackgroundcolor-gradient/
* Add some padding
*
* @default {highcharts} 0.01
* @default {highstock|highmaps} 0
* @since 1.2.0
*/
maxPadding: 0.01,
/**
* Deprecated. Use `minRange` instead.
*
* @deprecated
* @type {number}
* @product highcharts highstock
* @apioption xAxis.maxZoom
*/
/**
* The minimum value of the axis. If `null` the min value is
* automatically calculated.
*
* If the [startOnTick](#yAxis.startOnTick) option is true (default),
* the `min` value might be rounded down.
*
* The automatically calculated minimum value is also affected by
* [floor](#yAxis.floor), [softMin](#yAxis.softMin),
* [minPadding](#yAxis.minPadding), [minRange](#yAxis.minRange)
* as well as [series.threshold](#plotOptions.series.threshold)
* and [series.softThreshold](#plotOptions.series.softThreshold).
*
* @sample {highcharts} highcharts/yaxis/min-startontick-false/
* -50 with startOnTick to false
* @sample {highcharts} highcharts/yaxis/min-startontick-true/
* -50 with startOnTick true by default
* @sample {highstock} stock/xaxis/min-max/
* Set min and max on X axis
* @sample {highmaps} maps/axis/min-max/
* Pre-zoomed to a specific area
*
* @type {number}
* @apioption xAxis.min
*/
/**
* The dash or dot style of the minor grid lines. For possible values,
* see [this demonstration](https://jsfiddle.net/gh/get/library/pure/
* highcharts/highcharts/tree/master/samples/highcharts/plotoptions/
* series-dashstyle-all/).
*
* @sample {highcharts} highcharts/yaxis/minorgridlinedashstyle/
* Long dashes on minor grid lines
* @sample {highstock} stock/xaxis/minorgridlinedashstyle/
* Long dashes on minor grid lines
*
* @type {string}
* @default Solid
* @since 1.2
* @validvalue ["Solid", "ShortDash", "ShortDot", "ShortDashDot",
* "ShortDashDotDot", "Dot", "Dash" ,"LongDash",
* "DashDot", "LongDashDot", "LongDashDotDot"]
* @apioption xAxis.minorGridLineDashStyle
*/
/**
* Specific tick interval in axis units for the minor ticks. On a linear
* axis, if `"auto"`, the minor tick interval is calculated as a fifth
* of the tickInterval. If `null` or `undefined`, minor ticks are not
* shown.
*
* On logarithmic axes, the unit is the power of the value. For example,
* setting the minorTickInterval to 1 puts one tick on each of 0.1, 1,
* 10, 100 etc. Setting the minorTickInterval to 0.1 produces 9 ticks
* between 1 and 10, 10 and 100 etc.
*
* If user settings dictate minor ticks to become too dense, they don't
* make sense, and will be ignored to prevent performance problems.
*
* @sample {highcharts} highcharts/yaxis/minortickinterval-null/
* Null by default
* @sample {highcharts} highcharts/yaxis/minortickinterval-5/
* 5 units
* @sample {highcharts} highcharts/yaxis/minortickinterval-log-auto/
* "auto"
* @sample {highcharts} highcharts/yaxis/minortickinterval-log/
* 0.1
* @sample {highstock} stock/demo/basic-line/
* Null by default
* @sample {highstock} stock/xaxis/minortickinterval-auto/
* "auto"
*
* @type {number|string|null}
* @apioption xAxis.minorTickInterval
*/
/**
* The pixel length of the minor tick marks.
*
* @sample {highcharts} highcharts/yaxis/minorticklength/
* 10px on Y axis
* @sample {highstock} stock/xaxis/minorticks/
* 10px on Y axis
*/
minorTickLength: 2,
/**
* The position of the minor tick marks relative to the axis line.
* Can be one of `inside` and `outside`.
*
* @sample {highcharts} highcharts/yaxis/minortickposition-outside/
* Outside by default
* @sample {highcharts} highcharts/yaxis/minortickposition-inside/
* Inside
* @sample {highstock} stock/xaxis/minorticks/
* Inside
*
* @validvalue ["inside", "outside"]
*/
minorTickPosition: 'outside',
/**
* Enable or disable minor ticks. Unless
* [minorTickInterval](#xAxis.minorTickInterval) is set, the tick
* interval is calculated as a fifth of the `tickInterval`.
*
* On a logarithmic axis, minor ticks are laid out based on a best
* guess, attempting to enter approximately 5 minor ticks between
* each major tick.
*
* Prior to v6.0.0, ticks were unabled in auto layout by setting
* `minorTickInterval` to `"auto"`.
*
* @productdesc {highcharts}
* On axes using [categories](#xAxis.categories), minor ticks are not
* supported.
*
* @sample {highcharts} highcharts/yaxis/minorticks-true/
* Enabled on linear Y axis
*
* @type {boolean}
* @default false
* @since 6.0.0
* @apioption xAxis.minorTicks
*/
/**
* The pixel width of the minor tick mark.
*
* @sample {highcharts} highcharts/yaxis/minortickwidth/
* 3px width
* @sample {highstock} stock/xaxis/minorticks/
* 1px width
*
* @type {number}
* @default 0
* @apioption xAxis.minorTickWidth
*/
/**
* Padding of the min value relative to the length of the axis. A
* padding of 0.05 will make a 100px axis 5px longer. This is useful
* when you don't want the lowest data value to appear on the edge
* of the plot area. When the axis' `min` option is set or a min extreme
* is set using `axis.setExtremes()`, the minPadding will be ignored.
*
* @sample {highcharts} highcharts/yaxis/minpadding/
* Min padding of 0.2
* @sample {highstock} stock/xaxis/minpadding-maxpadding/
* Greater min- and maxPadding
* @sample {highmaps} maps/chart/plotbackgroundcolor-gradient/
* Add some padding
*
* @default {highcharts} 0.01
* @default {highstock|highmaps} 0
* @since 1.2.0
* @product highcharts highstock gantt
*/
minPadding: 0.01,
/**
* The minimum range to display on this axis. The entire axis will not
* be allowed to span over a smaller interval than this. For example,
* for a datetime axis the main unit is milliseconds. If minRange is
* set to 3600000, you can't zoom in more than to one hour.
*
* The default minRange for the x axis is five times the smallest
* interval between any of the data points.
*
* On a logarithmic axis, the unit for the minimum range is the power.
* So a minRange of 1 means that the axis can be zoomed to 10-100,
* 100-1000, 1000-10000 etc.
*
* Note that the `minPadding`, `maxPadding`, `startOnTick` and
* `endOnTick` settings also affect how the extremes of the axis
* are computed.
*
* @sample {highcharts} highcharts/xaxis/minrange/
* Minimum range of 5
* @sample {highstock} stock/xaxis/minrange/
* Max zoom of 6 months overrides user selections
* @sample {highmaps} maps/axis/minrange/
* Minimum range of 1000
*
* @type {number}
* @apioption xAxis.minRange
*/
/**
* The minimum tick interval allowed in axis values. For example on
* zooming in on an axis with daily data, this can be used to prevent
* the axis from showing hours. Defaults to the closest distance between
* two points on the axis.
*
* @type {number}
* @since 2.3.0
* @apioption xAxis.minTickInterval
*/
/**
* The distance in pixels from the plot area to the axis line.
* A positive offset moves the axis with it's line, labels and ticks
* away from the plot area. This is typically used when two or more
* axes are displayed on the same side of the plot. With multiple
* axes the offset is dynamically adjusted to avoid collision, this
* can be overridden by setting offset explicitly.
*
* @sample {highcharts} highcharts/yaxis/offset/
* Y axis offset of 70
* @sample {highcharts} highcharts/yaxis/offset-centered/
* Axes positioned in the center of the plot
* @sample {highstock} stock/xaxis/offset/
* Y axis offset by 70 px
*
* @type {number}
* @default 0
* @apioption xAxis.offset
*/
/**
* Whether to display the axis on the opposite side of the normal. The
* normal is on the left side for vertical axes and bottom for
* horizontal, so the opposite sides will be right and top respectively.
* This is typically used with dual or multiple axes.
*
* @sample {highcharts} highcharts/yaxis/opposite/
* Secondary