/**
* @license Highcharts JS v6.0.0 (2017-10-04)
* Highcharts Drilldown module
*
* Author: Torstein Honsi
* License: www.highcharts.com/license
*
*/
'use strict';
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Highcharts Drilldown module
*
* Author: Torstein Honsi
* License: www.highcharts.com/license
*
*/
var noop = H.noop,
color = H.color,
defaultOptions = H.defaultOptions,
each = H.each,
extend = H.extend,
format = H.format,
objectEach = H.objectEach,
pick = H.pick,
wrap = H.wrap,
Chart = H.Chart,
seriesTypes = H.seriesTypes,
PieSeries = seriesTypes.pie,
ColumnSeries = seriesTypes.column,
Tick = H.Tick,
fireEvent = H.fireEvent,
inArray = H.inArray,
ddSeriesId = 1;
// Add language
extend(defaultOptions.lang, {
/**
* The text for the button that appears when drilling down, linking
* back to the parent series. The parent series' name is inserted for
* `{series.name}`.
*
* @type {String}
* @default Back to {series.name}
* @since 3.0.8
* @product highcharts highmaps
* @apioption lang.drillUpText
*/
drillUpText: '◁ Back to {series.name}'
});
/**
* Options for drill down, the concept of inspecting increasingly high
* resolution data through clicking on chart items like columns or pie slices.
*
* The drilldown feature requires the drilldown.js file to be loaded,
* found in the modules directory of the download package, or online at
* (code.highcharts.com/modules/drilldown.js)[code.highcharts.com/modules/drilldown.js].
*
* @type {Object}
* @optionparent drilldown
*/
defaultOptions.drilldown = {
/**
* When this option is false, clicking a single point will drill down
* all points in the same category, equivalent to clicking the X axis
* label.
*
* @type {Boolean}
* @sample {highcharts} highcharts/drilldown/allowpointdrilldown-false/
* Don't allow point drilldown
* @default true
* @since 4.1.7
* @product highcharts
* @apioption drilldown.allowPointDrilldown
*/
/**
* Additional styles to apply to the X axis label for a point that
* has drilldown data. By default it is underlined and blue to invite
* to interaction.
*
* @type {CSSObject}
* @see In styled mode, active label styles can be set with the `.highcharts-drilldown-axis-label` class.
* @sample {highcharts} highcharts/drilldown/labels/ Label styles
* @default { "cursor": "pointer", "color": "#003399", "fontWeight": "bold", "textDecoration": "underline" }
* @since 3.0.8
* @product highcharts highmaps
*/
activeAxisLabelStyle: {
cursor: 'pointer',
color: '#003399',
fontWeight: 'bold',
textDecoration: 'underline'
},
/**
* Additional styles to apply to the data label of a point that has
* drilldown data. By default it is underlined and blue to invite to
* interaction.
*
* @type {CSSObject}
* @see In styled mode, active data label styles can be applied with
* the `.highcharts-drilldown-data-label` class.
* @sample {highcharts} highcharts/drilldown/labels/ Label styles
* @default { "cursor": "pointer", "color": "#003399", "fontWeight": "bold", "textDecoration": "underline" }
* @since 3.0.8
* @product highcharts highmaps
*/
activeDataLabelStyle: {
cursor: 'pointer',
color: '#003399',
fontWeight: 'bold',
textDecoration: 'underline'
},
/**
* Set the animation for all drilldown animations. Animation of a drilldown
* occurs when drilling between a column point and a column series,
* or a pie slice and a full pie series. Drilldown can still be used
* between series and points of different types, but animation will
* not occur.
*
* The animation can either be set as a boolean or a configuration
* object. If `true`, it will use the 'swing' jQuery easing and a duration
* of 500 ms. If used as a configuration object, the following properties
* are supported:
*
*
*
*
duration
*
*
The duration of the animation in milliseconds.
*
*
easing
*
*
A string reference to an easing function set on the `Math` object.
* See [the easing demo](http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-
* animation-easing/).
*
*
*
* @type {Boolean|Object}
* @since 3.0.8
* @product highcharts highmaps
*/
animation: {
/**
* Duration for the drilldown animation.
* @default 500
*/
duration: 500
},
/**
* Options for the drill up button that appears when drilling down
* on a series. The text for the button is defined in [lang.drillUpText](#lang.
* drillUpText).
*
* @type {Object}
* @sample {highcharts} highcharts/drilldown/drillupbutton/ Drill up button
* @sample {highmaps} highcharts/drilldown/drillupbutton/ Drill up button
* @since 3.0.8
* @product highcharts highmaps
*/
drillUpButton: {
/**
* Positioning options for the button within the `relativeTo` box.
* Available properties are `x`, `y`, `align` and `verticalAlign`.
*
* @type {Object}
* @since 3.0.8
* @product highcharts highmaps
*/
position: {
/**
* Horizontal alignment.
* @type {String}
*/
align: 'right',
/**
* The X offset of the button.
* @type {Number}
*/
x: -10,
/**
* The Y offset of the button.
* @type {Number}
*/
y: 10
/**
* Vertical alignment of the button.
*
* @type {String}
* @default top
* @validvalue ["top", "middle", "bottom"]
* @product highcharts highmaps
* @apioption drilldown.drillUpButton.position.verticalAlign
*/
}
/**
* What box to align the button to. Can be either `plotBox` or
* `spacingBox.
*
* @type {String}
* @default plotBox
* @validvalue ["plotBox", "spacingBox"]
* @since 3.0.8
* @product highcharts highmaps
* @apioption drilldown.drillUpButton.relativeTo
*/
/**
* A collection of attributes for the button. The object takes SVG attributes
* like `fill`, `stroke`, `stroke-width` or `r`, the border radius.
* The theme also supports `style`, a collection of CSS properties for
* the text. Equivalent attributes for the hover state are given in
* `theme.states.hover`.
*
* @type {Object}
* @see In styled mode, drill-up button styles can be applied with the
* `.highcharts-drillup-button` class.
* @sample {highcharts} highcharts/drilldown/drillupbutton/
* Button theming
* @sample {highmaps} highcharts/drilldown/drillupbutton/
* Button theming
* @since 3.0.8
* @product highcharts highmaps
* @apioption drilldown.drillUpButton.theme
*/
}
/**
* An array of series configurations for the drill down. Each series
* configuration uses the same syntax as the [series](#series) option
* set. These drilldown series are hidden by default. The drilldown
* series is linked to the parent series' point by its `id`.
*
* @type {Array