highcharts-rails 5.0.12 → 5.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +59 -0
- data/app/assets/javascripts/highcharts.js +6250 -788
- data/app/assets/javascripts/highcharts/highcharts-3d.js +210 -25
- data/app/assets/javascripts/highcharts/highcharts-more.js +908 -22
- data/app/assets/javascripts/highcharts/modules/accessibility.js +272 -64
- data/app/assets/javascripts/highcharts/modules/annotations.js +1 -1
- data/app/assets/javascripts/highcharts/modules/boost.js +89 -66
- data/app/assets/javascripts/highcharts/modules/broken-axis.js +65 -4
- data/app/assets/javascripts/highcharts/modules/data.js +1 -1
- data/app/assets/javascripts/highcharts/modules/drilldown.js +234 -17
- data/app/assets/javascripts/highcharts/modules/exporting.js +508 -69
- data/app/assets/javascripts/highcharts/modules/funnel.js +129 -8
- data/app/assets/javascripts/highcharts/modules/grid-axis.js +1 -1
- data/app/assets/javascripts/highcharts/modules/heatmap.js +361 -44
- data/app/assets/javascripts/highcharts/modules/no-data-to-display.js +64 -1
- data/app/assets/javascripts/highcharts/modules/offline-exporting.js +44 -44
- data/app/assets/javascripts/highcharts/modules/overlapping-datalabels.js +26 -3
- data/app/assets/javascripts/highcharts/modules/series-label.js +19 -1
- data/app/assets/javascripts/highcharts/modules/solid-gauge.js +14 -5
- data/app/assets/javascripts/highcharts/modules/stock.js +1122 -86
- data/app/assets/javascripts/highcharts/modules/treemap.js +265 -43
- data/app/assets/javascripts/highcharts/modules/xrange-series.js +1 -1
- data/lib/highcharts/version.rb +1 -1
- metadata +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Highcharts JS v5.0.
|
2
|
+
* @license Highcharts JS v5.0.13 (2017-07-27)
|
3
3
|
* Plugin for displaying a message when there is no data visible in chart.
|
4
4
|
*
|
5
5
|
* (c) 2010-2017 Highsoft AS
|
@@ -37,11 +37,61 @@
|
|
37
37
|
});
|
38
38
|
|
39
39
|
// Add default display options for message
|
40
|
+
/**
|
41
|
+
* Options for displaying a message like "No data to display".
|
42
|
+
* This feature requires the file no-data-to-display.js to be loaded in the page.
|
43
|
+
* The actual text to display is set in the lang.noData option.
|
44
|
+
* @type {Object}
|
45
|
+
* @optionparent noData
|
46
|
+
*/
|
40
47
|
defaultOptions.noData = {
|
48
|
+
|
49
|
+
/**
|
50
|
+
* The position of the no-data label, relative to the plot area.
|
51
|
+
*
|
52
|
+
* @type {Object}
|
53
|
+
* @default { "x": 0, "y": 0, "align": "center", "verticalAlign": "middle" }
|
54
|
+
* @since 3.0.8
|
55
|
+
* @product highcharts highstock highmaps
|
56
|
+
*/
|
41
57
|
position: {
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Horizontal offset of the label, in pixels.
|
61
|
+
*
|
62
|
+
* @type {Number}
|
63
|
+
* @default 0
|
64
|
+
* @product highcharts highstock
|
65
|
+
*/
|
42
66
|
x: 0,
|
67
|
+
|
68
|
+
/**
|
69
|
+
* Vertical offset of the label, in pixels.
|
70
|
+
*
|
71
|
+
* @type {Number}
|
72
|
+
* @default 0
|
73
|
+
* @product highcharts highstock
|
74
|
+
*/
|
43
75
|
y: 0,
|
76
|
+
|
77
|
+
/**
|
78
|
+
* Horizontal alignment of the label.
|
79
|
+
*
|
80
|
+
* @validvalue ["left", "center", "right"]
|
81
|
+
* @type {String}
|
82
|
+
* @default center
|
83
|
+
* @product highcharts highstock highmaps
|
84
|
+
*/
|
44
85
|
align: 'center',
|
86
|
+
|
87
|
+
/**
|
88
|
+
* Vertical alignment of the label.
|
89
|
+
*
|
90
|
+
* @validvalue ["top", "middle", "bottom"]
|
91
|
+
* @type {String}
|
92
|
+
* @default middle
|
93
|
+
* @product highcharts highstock
|
94
|
+
*/
|
45
95
|
verticalAlign: 'middle'
|
46
96
|
}
|
47
97
|
// useHTML: false
|
@@ -49,9 +99,22 @@
|
|
49
99
|
|
50
100
|
|
51
101
|
// Presentational
|
102
|
+
/**
|
103
|
+
* CSS styles for the no-data label.
|
104
|
+
* @optionparent noData.style
|
105
|
+
*/
|
52
106
|
defaultOptions.noData.style = {
|
107
|
+
|
108
|
+
/**
|
109
|
+
*/
|
53
110
|
fontWeight: 'bold',
|
111
|
+
|
112
|
+
/**
|
113
|
+
*/
|
54
114
|
fontSize: '12px',
|
115
|
+
|
116
|
+
/**
|
117
|
+
*/
|
55
118
|
color: '#666666'
|
56
119
|
};
|
57
120
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Highcharts JS v5.0.
|
2
|
+
* @license Highcharts JS v5.0.13 (2017-07-27)
|
3
3
|
* Client side exporting module
|
4
4
|
*
|
5
5
|
* (c) 2015 Torstein Honsi / Oystein Moseng
|
@@ -91,14 +91,19 @@
|
|
91
91
|
windowRef;
|
92
92
|
|
93
93
|
// IE specific blob implementation
|
94
|
-
|
94
|
+
// Don't use for normal dataURLs
|
95
|
+
if (
|
96
|
+
typeof dataURL !== 'string' &&
|
97
|
+
!(dataURL instanceof String) &&
|
98
|
+
nav.msSaveOrOpenBlob
|
99
|
+
) {
|
95
100
|
nav.msSaveOrOpenBlob(dataURL, filename);
|
96
101
|
return;
|
97
102
|
}
|
98
103
|
|
99
104
|
// Some browsers have limitations for data URL lengths. Try to convert to
|
100
|
-
// Blob or fall back.
|
101
|
-
if (dataURL.length > 2000000) {
|
105
|
+
// Blob or fall back. Edge always needs that blob.
|
106
|
+
if (isEdgeBrowser || dataURL.length > 2000000) {
|
102
107
|
dataURL = Highcharts.dataURLtoBlob(dataURL);
|
103
108
|
if (!dataURL) {
|
104
109
|
throw 'Data URL length limit reached';
|
@@ -487,7 +492,6 @@
|
|
487
492
|
|
488
493
|
// Always fall back on:
|
489
494
|
// - MS browsers: Embedded images JPEG/PNG, or any PDF
|
490
|
-
// - Edge: PNG/JPEG all cases
|
491
495
|
// - Embedded images and PDF
|
492
496
|
if (
|
493
497
|
(
|
@@ -497,8 +501,6 @@
|
|
497
501
|
chart.container.getElementsByTagName('image').length &&
|
498
502
|
options.type !== 'image/svg+xml'
|
499
503
|
)
|
500
|
-
) || (
|
501
|
-
isEdgeBrowser && options.type !== 'image/svg+xml'
|
502
504
|
) || (
|
503
505
|
options.type === 'application/pdf' &&
|
504
506
|
chart.container.getElementsByTagName('image').length
|
@@ -513,44 +515,42 @@
|
|
513
515
|
|
514
516
|
// Extend the default options to use the local exporter logic
|
515
517
|
merge(true, Highcharts.getOptions().exporting, {
|
516
|
-
libURL: 'https://code.highcharts.com/5.0.
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
});
|
551
|
-
}
|
552
|
-
}]
|
518
|
+
libURL: 'https://code.highcharts.com/5.0.13/lib/',
|
519
|
+
|
520
|
+
// When offline-exporting is loaded, redefine the menu item definitions
|
521
|
+
// related to download.
|
522
|
+
menuItemDefinitions: {
|
523
|
+
downloadPNG: {
|
524
|
+
textKey: 'downloadPNG',
|
525
|
+
onclick: function() {
|
526
|
+
this.exportChartLocal();
|
527
|
+
}
|
528
|
+
},
|
529
|
+
downloadJPEG: {
|
530
|
+
textKey: 'downloadJPEG',
|
531
|
+
onclick: function() {
|
532
|
+
this.exportChartLocal({
|
533
|
+
type: 'image/jpeg'
|
534
|
+
});
|
535
|
+
}
|
536
|
+
},
|
537
|
+
downloadSVG: {
|
538
|
+
textKey: 'downloadSVG',
|
539
|
+
onclick: function() {
|
540
|
+
this.exportChartLocal({
|
541
|
+
type: 'image/svg+xml'
|
542
|
+
});
|
543
|
+
}
|
544
|
+
},
|
545
|
+
downloadPDF: {
|
546
|
+
textKey: 'downloadPDF',
|
547
|
+
onclick: function() {
|
548
|
+
this.exportChartLocal({
|
549
|
+
type: 'application/pdf'
|
550
|
+
});
|
551
|
+
}
|
553
552
|
}
|
553
|
+
|
554
554
|
}
|
555
555
|
});
|
556
556
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Highcharts JS v5.0.
|
2
|
+
* @license Highcharts JS v5.0.13 (2017-07-27)
|
3
3
|
*
|
4
4
|
* (c) 2009-2017 Torstein Honsi
|
5
5
|
*
|
@@ -25,6 +25,7 @@
|
|
25
25
|
*/
|
26
26
|
var Chart = H.Chart,
|
27
27
|
each = H.each,
|
28
|
+
objectEach = H.objectEach,
|
28
29
|
pick = H.pick,
|
29
30
|
addEvent = H.addEvent;
|
30
31
|
|
@@ -35,6 +36,19 @@
|
|
35
36
|
function collectAndHide() {
|
36
37
|
var labels = [];
|
37
38
|
|
39
|
+
each(chart.yAxis, function(yAxis) {
|
40
|
+
if (
|
41
|
+
yAxis.options.stackLabels &&
|
42
|
+
!yAxis.options.stackLabels.allowOverlap
|
43
|
+
) {
|
44
|
+
objectEach(yAxis.stacks, function(stack) {
|
45
|
+
objectEach(stack, function(stackItem) {
|
46
|
+
labels.push(stackItem.label);
|
47
|
+
});
|
48
|
+
});
|
49
|
+
}
|
50
|
+
});
|
51
|
+
|
38
52
|
each(chart.series || [], function(series) {
|
39
53
|
var dlOptions = series.options.dataLabels,
|
40
54
|
// Range series have two collections
|
@@ -87,6 +101,7 @@
|
|
87
101
|
parent1,
|
88
102
|
parent2,
|
89
103
|
padding,
|
104
|
+
bBox,
|
90
105
|
intersectRect = function(x1, y1, w1, h1, x2, y2, w2, h2) {
|
91
106
|
return !(
|
92
107
|
x2 > x1 + w1 ||
|
@@ -96,12 +111,20 @@
|
|
96
111
|
);
|
97
112
|
};
|
98
113
|
|
99
|
-
// Mark with initial opacity
|
100
114
|
for (i = 0; i < len; i++) {
|
101
115
|
label = labels[i];
|
102
116
|
if (label) {
|
117
|
+
|
118
|
+
// Mark with initial opacity
|
103
119
|
label.oldOpacity = label.opacity;
|
104
120
|
label.newOpacity = 1;
|
121
|
+
|
122
|
+
// Get width and height if pure text nodes (stack labels)
|
123
|
+
if (!label.width) {
|
124
|
+
bBox = label.getBBox();
|
125
|
+
label.width = bBox.width;
|
126
|
+
label.height = bBox.height;
|
127
|
+
}
|
105
128
|
}
|
106
129
|
}
|
107
130
|
|
@@ -129,7 +152,7 @@
|
|
129
152
|
parent1 = label1.parentGroup;
|
130
153
|
parent2 = label2.parentGroup;
|
131
154
|
// Substract the padding if no background or border (#4333)
|
132
|
-
padding = 2 * (label1.box ? 0 : label1.padding);
|
155
|
+
padding = 2 * (label1.box ? 0 : (label1.padding || 0));
|
133
156
|
isIntersecting = intersectRect(
|
134
157
|
pos1.x + parent1.translateX,
|
135
158
|
pos1.y + parent1.translateY,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Highcharts JS v5.0.
|
2
|
+
* @license Highcharts JS v5.0.13 (2017-07-27)
|
3
3
|
*
|
4
4
|
* (c) 2009-2017 Torstein Honsi
|
5
5
|
*
|
@@ -47,13 +47,31 @@
|
|
47
47
|
H.setOptions({
|
48
48
|
plotOptions: {
|
49
49
|
series: {
|
50
|
+
|
51
|
+
/**
|
52
|
+
*/
|
50
53
|
label: {
|
54
|
+
|
55
|
+
/**
|
56
|
+
*/
|
51
57
|
enabled: true,
|
52
58
|
// Allow labels to be placed distant to the graph if necessary, and
|
53
59
|
// draw a connector line to the graph
|
60
|
+
|
61
|
+
/**
|
62
|
+
*/
|
54
63
|
connectorAllowed: true,
|
64
|
+
|
65
|
+
/**
|
66
|
+
*/
|
55
67
|
connectorNeighbourDistance: 24, // If the label is closer than this to a neighbour graph, draw a connector
|
68
|
+
|
69
|
+
/**
|
70
|
+
*/
|
56
71
|
styles: {
|
72
|
+
|
73
|
+
/**
|
74
|
+
*/
|
57
75
|
fontWeight: 'bold'
|
58
76
|
}
|
59
77
|
// boxesToAvoid: []
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Highcharts JS v5.0.
|
2
|
+
* @license Highcharts JS v5.0.13 (2017-07-27)
|
3
3
|
* Solid angular gauge module
|
4
4
|
*
|
5
5
|
* (c) 2010-2017 Torstein Honsi
|
@@ -61,6 +61,7 @@
|
|
61
61
|
// Insert rounded edge on end, and remove line.
|
62
62
|
path.splice.apply(path, [11, 3].concat(roundEnd));
|
63
63
|
}
|
64
|
+
|
64
65
|
return path;
|
65
66
|
});
|
66
67
|
|
@@ -162,12 +163,20 @@
|
|
162
163
|
return color;
|
163
164
|
}
|
164
165
|
};
|
165
|
-
|
166
|
-
|
167
|
-
|
166
|
+
/**
|
167
|
+
* @extends plotOptions.gauge
|
168
|
+
* @optionparent plotOptions.solidgauge
|
169
|
+
*/
|
170
|
+
var solidGaugeOptions = {
|
171
|
+
/**
|
172
|
+
*/
|
168
173
|
colorByPoint: true
|
169
174
|
|
170
|
-
}
|
175
|
+
};
|
176
|
+
|
177
|
+
|
178
|
+
// The solidgauge series type
|
179
|
+
H.seriesType('solidgauge', 'gauge', solidGaugeOptions, {
|
171
180
|
|
172
181
|
/**
|
173
182
|
* Extend the translate function to extend the Y axis with the necessary
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Highcharts JS v5.0.
|
2
|
+
* @license Highcharts JS v5.0.13 (2017-07-27)
|
3
3
|
* Highstock as a plugin for Highcharts
|
4
4
|
*
|
5
5
|
* (c) 2017 Torstein Honsi
|
@@ -1026,19 +1026,80 @@
|
|
1026
1026
|
H.Series.prototype.gappedPath = function() {
|
1027
1027
|
var gapSize = this.options.gapSize,
|
1028
1028
|
points = this.points.slice(),
|
1029
|
-
i = points.length - 1
|
1029
|
+
i = points.length - 1,
|
1030
|
+
yAxis = this.yAxis,
|
1031
|
+
xRange,
|
1032
|
+
stack;
|
1033
|
+
|
1034
|
+
/**
|
1035
|
+
* Defines when to display a gap in the graph, together with the `gapUnit`
|
1036
|
+
* option.
|
1037
|
+
*
|
1038
|
+
* When the `gapUnit` is `relative` (default), a gap size of 5 means
|
1039
|
+
* that if the distance between two points is greater than five times
|
1040
|
+
* that of the two closest points, the graph will be broken.
|
1041
|
+
*
|
1042
|
+
* When the `gapUnit` is `value`, the gap is based on absolute axis values,
|
1043
|
+
* which on a datetime axis is milliseconds.
|
1044
|
+
*
|
1045
|
+
* In practice, this option is most often used to visualize gaps in
|
1046
|
+
* time series. In a stock chart, intraday data is available for daytime
|
1047
|
+
* hours, while gaps will appear in nights and weekends.
|
1048
|
+
*
|
1049
|
+
* @type {Number}
|
1050
|
+
* @see [xAxis.breaks](#xAxis.breaks)
|
1051
|
+
* @sample {highstock} stock/plotoptions/series-gapsize/
|
1052
|
+
* Setting the gap size to 2 introduces gaps for weekends in daily
|
1053
|
+
* datasets.
|
1054
|
+
* @default 0
|
1055
|
+
* @product highstock
|
1056
|
+
* @apioption plotOptions.series.gapSize
|
1057
|
+
*/
|
1058
|
+
|
1059
|
+
/**
|
1060
|
+
* Together with `gapSize`, this option defines where to draw gaps in the
|
1061
|
+
* graph.
|
1062
|
+
*
|
1063
|
+
* @type {String}
|
1064
|
+
* @see [gapSize](plotOptions.series.gapSize)
|
1065
|
+
* @default relative
|
1066
|
+
* @validvalues ["relative", "value"]
|
1067
|
+
* @since 5.0.13
|
1068
|
+
* @product highstock
|
1069
|
+
* @apioption plotOptions.series.gapUnit
|
1070
|
+
*/
|
1030
1071
|
|
1031
1072
|
if (gapSize && i > 0) { // #5008
|
1032
1073
|
|
1074
|
+
// Gap unit is relative
|
1075
|
+
if (this.options.gapUnit !== 'value') {
|
1076
|
+
gapSize *= this.closestPointRange;
|
1077
|
+
}
|
1078
|
+
|
1033
1079
|
// extension for ordinal breaks
|
1034
1080
|
while (i--) {
|
1035
|
-
if (points[i + 1].x - points[i].x >
|
1081
|
+
if (points[i + 1].x - points[i].x > gapSize) {
|
1082
|
+
xRange = (points[i].x + points[i + 1].x) / 2;
|
1083
|
+
|
1036
1084
|
points.splice( // insert after this one
|
1037
1085
|
i + 1,
|
1038
1086
|
0, {
|
1039
|
-
isNull: true
|
1087
|
+
isNull: true,
|
1088
|
+
x: xRange
|
1040
1089
|
}
|
1041
1090
|
);
|
1091
|
+
|
1092
|
+
// For stacked chart generate empty stack items, #6546
|
1093
|
+
if (this.options.stacking) {
|
1094
|
+
stack = yAxis.stacks[this.stackKey][xRange] = new H.StackItem(
|
1095
|
+
yAxis,
|
1096
|
+
yAxis.options.stackLabels,
|
1097
|
+
false,
|
1098
|
+
xRange,
|
1099
|
+
this.stack
|
1100
|
+
);
|
1101
|
+
stack.total = 0;
|
1102
|
+
}
|
1042
1103
|
}
|
1043
1104
|
}
|
1044
1105
|
}
|
@@ -1086,6 +1147,9 @@
|
|
1086
1147
|
baseGeneratePoints = seriesProto.generatePoints,
|
1087
1148
|
baseDestroy = seriesProto.destroy,
|
1088
1149
|
|
1150
|
+
/**
|
1151
|
+
*
|
1152
|
+
*/
|
1089
1153
|
commonOptions = {
|
1090
1154
|
approximation: 'average', // average, open, high, low, close, sum
|
1091
1155
|
//enabled: null, // (true for stock charts, false for basic),
|
@@ -1749,10 +1813,29 @@
|
|
1749
1813
|
* @constructor seriesTypes.ohlc
|
1750
1814
|
* @augments seriesTypes.column
|
1751
1815
|
*/
|
1816
|
+
/**
|
1817
|
+
* @extends {plotOptions.column}
|
1818
|
+
* @optionparent plotOptions.ohlc
|
1819
|
+
*/
|
1752
1820
|
seriesType('ohlc', 'column', {
|
1821
|
+
|
1822
|
+
/**
|
1823
|
+
* The pixel width of the line/border. Defaults to `1`.
|
1824
|
+
*
|
1825
|
+
* @type {Number}
|
1826
|
+
* @sample {highstock} stock/plotoptions/ohlc-linewidth/ A greater line width
|
1827
|
+
* @default 1
|
1828
|
+
* @product highstock
|
1829
|
+
*/
|
1753
1830
|
lineWidth: 1,
|
1831
|
+
|
1832
|
+
/**
|
1833
|
+
*/
|
1754
1834
|
tooltip: {
|
1755
1835
|
|
1836
|
+
|
1837
|
+
/**
|
1838
|
+
*/
|
1756
1839
|
pointFormat: '<span style="color:{point.color}">\u25CF</span> <b> {series.name}</b><br/>' +
|
1757
1840
|
'Open: {point.open}<br/>' +
|
1758
1841
|
'High: {point.high}<br/>' +
|
@@ -1760,13 +1843,36 @@
|
|
1760
1843
|
'Close: {point.close}<br/>'
|
1761
1844
|
|
1762
1845
|
},
|
1846
|
+
|
1847
|
+
/**
|
1848
|
+
*/
|
1763
1849
|
threshold: null,
|
1764
1850
|
|
1851
|
+
|
1852
|
+
/**
|
1853
|
+
*/
|
1765
1854
|
states: {
|
1855
|
+
|
1856
|
+
/**
|
1857
|
+
* @extends plotOptions.column.states.hover
|
1858
|
+
* @product highstock
|
1859
|
+
*/
|
1766
1860
|
hover: {
|
1861
|
+
|
1862
|
+
/**
|
1863
|
+
* The pixel width of the line representing the OHLC point. Defaults
|
1864
|
+
* to `3`.
|
1865
|
+
*
|
1866
|
+
* @type {Number}
|
1867
|
+
* @default 3
|
1868
|
+
* @product highstock
|
1869
|
+
*/
|
1767
1870
|
lineWidth: 3
|
1768
1871
|
}
|
1769
1872
|
},
|
1873
|
+
|
1874
|
+
/**
|
1875
|
+
*/
|
1770
1876
|
stickyTracking: true
|
1771
1877
|
//upColor: undefined
|
1772
1878
|
|
@@ -1952,28 +2058,105 @@
|
|
1952
2058
|
seriesTypes = H.seriesTypes;
|
1953
2059
|
|
1954
2060
|
/**
|
1955
|
-
*
|
1956
|
-
*
|
1957
|
-
* @
|
1958
|
-
* @augments seriesTypes.ohlc
|
2061
|
+
* @extends {plotOptions.ohlc}
|
2062
|
+
* @products highstock
|
2063
|
+
* @optionparent plotOptions.candlestick
|
1959
2064
|
*/
|
1960
|
-
|
2065
|
+
var candlestickOptions = {
|
2066
|
+
|
2067
|
+
/**
|
2068
|
+
*/
|
1961
2069
|
states: {
|
2070
|
+
|
2071
|
+
/**
|
2072
|
+
* @extends plotOptions.column.states.hover
|
2073
|
+
* @product highstock
|
2074
|
+
*/
|
1962
2075
|
hover: {
|
2076
|
+
|
2077
|
+
/**
|
2078
|
+
* The pixel width of the line/border around the candlestick. Defaults
|
2079
|
+
* to `2`.
|
2080
|
+
*
|
2081
|
+
* @type {Number}
|
2082
|
+
* @default 2
|
2083
|
+
* @product highstock
|
2084
|
+
*/
|
1963
2085
|
lineWidth: 2
|
1964
2086
|
}
|
1965
2087
|
},
|
2088
|
+
|
2089
|
+
/**
|
2090
|
+
*/
|
1966
2091
|
tooltip: defaultPlotOptions.ohlc.tooltip,
|
2092
|
+
|
2093
|
+
/**
|
2094
|
+
*/
|
1967
2095
|
threshold: null,
|
1968
2096
|
|
2097
|
+
|
2098
|
+
/**
|
2099
|
+
* The color of the line/border of the candlestick.
|
2100
|
+
*
|
2101
|
+
* In [styled mode](http://www.highcharts.com/docs/chart-design-and-
|
2102
|
+
* style/style-by-css), the line stroke can be set with the `.highcharts-
|
2103
|
+
* candlestick-series .highcahrts-point` rule.
|
2104
|
+
*
|
2105
|
+
* @type {Color}
|
2106
|
+
* @see [upLineColor](#plotOptions.candlestick.upLineColor)
|
2107
|
+
* @sample {highstock} stock/plotoptions/candlestick-linecolor/ Candlestick line colors
|
2108
|
+
* @default #000000
|
2109
|
+
* @product highstock
|
2110
|
+
*/
|
1969
2111
|
lineColor: '#000000',
|
2112
|
+
|
2113
|
+
/**
|
2114
|
+
* The pixel width of the candlestick line/border. Defaults to `1`.
|
2115
|
+
*
|
2116
|
+
*
|
2117
|
+
* In [styled mode](http://www.highcharts.com/docs/chart-design-and-
|
2118
|
+
* style/style-by-css), the line stroke width can be set with the `.
|
2119
|
+
* highcharts-candlestick-series .highcahrts-point` rule.
|
2120
|
+
*
|
2121
|
+
* @type {Number}
|
2122
|
+
* @default 1
|
2123
|
+
* @product highstock
|
2124
|
+
*/
|
1970
2125
|
lineWidth: 1,
|
2126
|
+
|
2127
|
+
/**
|
2128
|
+
* The fill color of the candlestick when values are rising.
|
2129
|
+
*
|
2130
|
+
* In [styled mode](http://www.highcharts.com/docs/chart-design-and-
|
2131
|
+
* style/style-by-css), the up color can be set with the `.highcharts-
|
2132
|
+
* candlestick-series .highcharts-point-up` rule.
|
2133
|
+
*
|
2134
|
+
* @type {Color}
|
2135
|
+
* @sample {highstock} stock/plotoptions/candlestick-color/ Custom colors
|
2136
|
+
* @sample {highstock} highcharts/css/candlestick/ Colors in styled mode
|
2137
|
+
* @default #ffffff
|
2138
|
+
* @product highstock
|
2139
|
+
*/
|
1971
2140
|
upColor: '#ffffff',
|
2141
|
+
|
2142
|
+
/**
|
2143
|
+
*/
|
1972
2144
|
stickyTracking: true
|
1973
2145
|
// upLineColor: null
|
1974
2146
|
|
1975
2147
|
|
1976
|
-
}
|
2148
|
+
};
|
2149
|
+
|
2150
|
+
/**
|
2151
|
+
* The candlestick series type.
|
2152
|
+
*
|
2153
|
+
* @constructor seriesTypes.candlestick
|
2154
|
+
* @augments seriesTypes.ohlc
|
2155
|
+
*/
|
2156
|
+
seriesType('candlestick', 'ohlc', merge(
|
2157
|
+
defaultPlotOptions.column,
|
2158
|
+
candlestickOptions
|
2159
|
+
), /** @lends seriesTypes.candlestick */ {
|
1977
2160
|
|
1978
2161
|
/**
|
1979
2162
|
* Postprocess mapping between options and SVG attributes
|
@@ -2122,29 +2305,149 @@
|
|
2122
2305
|
* @constructor seriesTypes.flags
|
2123
2306
|
* @augments seriesTypes.column
|
2124
2307
|
*/
|
2308
|
+
/**
|
2309
|
+
* @extends {plotOptions.column}
|
2310
|
+
* @optionparent plotOptions.flags
|
2311
|
+
*/
|
2125
2312
|
seriesType('flags', 'column', {
|
2313
|
+
|
2314
|
+
/**
|
2315
|
+
*/
|
2126
2316
|
pointRange: 0, // #673
|
2127
2317
|
//radius: 2,
|
2318
|
+
|
2319
|
+
/**
|
2320
|
+
* The shape of the marker. Can be one of "flag", "circlepin", "squarepin",
|
2321
|
+
* or an image on the format `url(/path-to-image.jpg)`. Individual
|
2322
|
+
* shapes can also be set for each point.
|
2323
|
+
*
|
2324
|
+
* @validvalue ["flag", "circlepin", "squarepin"]
|
2325
|
+
* @type {String}
|
2326
|
+
* @sample {highstock} stock/plotoptions/flags/ Different shapes
|
2327
|
+
* @default flag
|
2328
|
+
* @product highstock
|
2329
|
+
*/
|
2128
2330
|
shape: 'flag',
|
2331
|
+
|
2332
|
+
/**
|
2333
|
+
* When multiple flags in the same series fall on the same value, this
|
2334
|
+
* number determines the vertical offset between them.
|
2335
|
+
*
|
2336
|
+
* @type {Number}
|
2337
|
+
* @sample {highstock} stock/plotoptions/flags-stackdistance/ A greater stack distance
|
2338
|
+
* @default 12
|
2339
|
+
* @product highstock
|
2340
|
+
*/
|
2129
2341
|
stackDistance: 12,
|
2342
|
+
|
2343
|
+
/**
|
2344
|
+
* Text alignment for the text inside the flag.
|
2345
|
+
*
|
2346
|
+
* @validvalue ["left", "center", "right"]
|
2347
|
+
* @type {String}
|
2348
|
+
* @default center
|
2349
|
+
* @since 5.0.0
|
2350
|
+
* @product highstock
|
2351
|
+
*/
|
2130
2352
|
textAlign: 'center',
|
2353
|
+
|
2354
|
+
/**
|
2355
|
+
* Specific tooltip options for flag series. Flag series tooltips are
|
2356
|
+
* different from most other types in that a flag doesn't have a data
|
2357
|
+
* value, so the tooltip rather displays the `text` option for each
|
2358
|
+
* point.
|
2359
|
+
*
|
2360
|
+
* @type {Object}
|
2361
|
+
* @extends plotOptions.series.tooltip
|
2362
|
+
* @excluding changeDecimals,valueDecimals,valuePrefix,valueSuffix
|
2363
|
+
* @product highstock
|
2364
|
+
*/
|
2131
2365
|
tooltip: {
|
2366
|
+
|
2367
|
+
/**
|
2368
|
+
*/
|
2132
2369
|
pointFormat: '{point.text}<br/>'
|
2133
2370
|
},
|
2371
|
+
|
2372
|
+
/**
|
2373
|
+
*/
|
2134
2374
|
threshold: null,
|
2375
|
+
|
2376
|
+
/**
|
2377
|
+
* The y position of the top left corner of the flag relative to either
|
2378
|
+
* the series (if onSeries is defined), or the x axis. Defaults to
|
2379
|
+
* `-30`.
|
2380
|
+
*
|
2381
|
+
* @type {Number}
|
2382
|
+
* @default -30
|
2383
|
+
* @product highstock
|
2384
|
+
*/
|
2135
2385
|
y: -30,
|
2136
2386
|
|
2387
|
+
|
2388
|
+
/**
|
2389
|
+
*/
|
2137
2390
|
fillColor: '#ffffff',
|
2138
2391
|
// lineColor: color,
|
2392
|
+
|
2393
|
+
/**
|
2394
|
+
* The pixel width of the candlestick line/border. Defaults to `1`.
|
2395
|
+
*
|
2396
|
+
* @type {Number}
|
2397
|
+
* @default 1
|
2398
|
+
* @product highstock
|
2399
|
+
*/
|
2139
2400
|
lineWidth: 1,
|
2401
|
+
|
2402
|
+
/**
|
2403
|
+
*/
|
2140
2404
|
states: {
|
2405
|
+
|
2406
|
+
/**
|
2407
|
+
* @extends plotOptions.column.states.hover
|
2408
|
+
* @product highstock
|
2409
|
+
*/
|
2141
2410
|
hover: {
|
2411
|
+
|
2412
|
+
/**
|
2413
|
+
* The color of the line/border of the flag Defaults to `"black"`.
|
2414
|
+
*
|
2415
|
+
* @type {String}
|
2416
|
+
* @default "black"
|
2417
|
+
* @product highstock
|
2418
|
+
*/
|
2142
2419
|
lineColor: '#000000',
|
2420
|
+
|
2421
|
+
/**
|
2422
|
+
* The fill or background color of the flag Defaults to `"#FCFFC5"`.
|
2423
|
+
*
|
2424
|
+
* @type {String}
|
2425
|
+
* @default "#FCFFC5"
|
2426
|
+
* @product highstock
|
2427
|
+
*/
|
2143
2428
|
fillColor: '#ccd6eb'
|
2144
2429
|
}
|
2145
2430
|
},
|
2431
|
+
|
2432
|
+
/**
|
2433
|
+
* The text styles of the flag.
|
2434
|
+
*
|
2435
|
+
* In [styled mode](http://www.highcharts.com/docs/chart-design-and-
|
2436
|
+
* style/style-by-css), the styles are set in the `.highcharts-flag-
|
2437
|
+
* series .highcharts-point` rule.
|
2438
|
+
*
|
2439
|
+
* @type {CSSObject}
|
2440
|
+
* @default { "fontSize": "11px", "fontWeight": "bold" }
|
2441
|
+
* @product highstock
|
2442
|
+
*/
|
2146
2443
|
style: {
|
2444
|
+
|
2445
|
+
/**
|
2446
|
+
*/
|
2147
2447
|
fontSize: '11px',
|
2448
|
+
|
2449
|
+
/**
|
2450
|
+
*/
|
2148
2451
|
fontWeight: 'bold'
|
2149
2452
|
}
|
2150
2453
|
|
@@ -2513,7 +2816,6 @@
|
|
2513
2816
|
defaultOptions = H.defaultOptions,
|
2514
2817
|
defined = H.defined,
|
2515
2818
|
destroyObjectProperties = H.destroyObjectProperties,
|
2516
|
-
doc = H.doc,
|
2517
2819
|
each = H.each,
|
2518
2820
|
fireEvent = H.fireEvent,
|
2519
2821
|
hasTouch = H.hasTouch,
|
@@ -2525,30 +2827,197 @@
|
|
2525
2827
|
wrap = H.wrap,
|
2526
2828
|
swapXY;
|
2527
2829
|
|
2830
|
+
/**
|
2831
|
+
*
|
2832
|
+
* The scrollbar is a means of panning over the X axis of a chart.
|
2833
|
+
*
|
2834
|
+
* In [styled mode](http://www.highcharts.com/docs/chart-design-
|
2835
|
+
* and-style/style-by-css), all the presentational options for the
|
2836
|
+
* scrollbar are replaced by the classes `.highcharts-scrollbar-
|
2837
|
+
* thumb`, `.highcharts-scrollbar-arrow`, `.highcharts-scrollbar-
|
2838
|
+
* button`, `.highcharts-scrollbar-rifles` and `.highcharts-scrollbar-
|
2839
|
+
* track`.
|
2840
|
+
*
|
2841
|
+
* @product highstock
|
2842
|
+
* @optionparent scrollbar
|
2843
|
+
*/
|
2528
2844
|
var defaultScrollbarOptions = {
|
2529
2845
|
//enabled: true
|
2846
|
+
|
2847
|
+
/**
|
2848
|
+
* The height of the scrollbar. The height also applies to the width
|
2849
|
+
* of the scroll arrows so that they are always squares. Defaults to
|
2850
|
+
* 20 for touch devices and 14 for mouse devices.
|
2851
|
+
*
|
2852
|
+
* @type {Number}
|
2853
|
+
* @sample {highstock} stock/scrollbar/height/ A 30px scrollbar
|
2854
|
+
* @product highstock
|
2855
|
+
*/
|
2530
2856
|
height: isTouchDevice ? 20 : 14,
|
2531
2857
|
// trackBorderRadius: 0
|
2858
|
+
|
2859
|
+
/**
|
2860
|
+
* The border rounding radius of the bar.
|
2861
|
+
*
|
2862
|
+
* @type {Number}
|
2863
|
+
* @sample {highstock} stock/scrollbar/style/ Scrollbar styling
|
2864
|
+
* @default 0
|
2865
|
+
* @product highstock
|
2866
|
+
*/
|
2532
2867
|
barBorderRadius: 0,
|
2868
|
+
|
2869
|
+
/**
|
2870
|
+
* The corner radius of the scrollbar buttons.
|
2871
|
+
*
|
2872
|
+
* @type {Number}
|
2873
|
+
* @sample {highstock} stock/scrollbar/style/ Scrollbar styling
|
2874
|
+
* @default 0
|
2875
|
+
* @product highstock
|
2876
|
+
*/
|
2533
2877
|
buttonBorderRadius: 0,
|
2878
|
+
|
2879
|
+
/**
|
2880
|
+
* Whether to redraw the main chart as the scrollbar or the navigator
|
2881
|
+
* zoomed window is moved. Defaults to `true` for modern browsers and
|
2882
|
+
* `false` for legacy IE browsers as well as mobile devices.
|
2883
|
+
*
|
2884
|
+
* @type {Boolean}
|
2885
|
+
* @since 1.3
|
2886
|
+
* @product highstock
|
2887
|
+
*/
|
2534
2888
|
liveRedraw: svg && !isTouchDevice,
|
2889
|
+
|
2890
|
+
/**
|
2891
|
+
*/
|
2535
2892
|
margin: 10,
|
2893
|
+
|
2894
|
+
/**
|
2895
|
+
* The minimum width of the scrollbar.
|
2896
|
+
*
|
2897
|
+
* @type {Number}
|
2898
|
+
* @default 6
|
2899
|
+
* @since 1.2.5
|
2900
|
+
* @product highstock
|
2901
|
+
*/
|
2536
2902
|
minWidth: 6,
|
2537
2903
|
//showFull: true,
|
2538
2904
|
//size: null,
|
2905
|
+
|
2906
|
+
/**
|
2907
|
+
*/
|
2539
2908
|
step: 0.2,
|
2909
|
+
|
2910
|
+
/**
|
2911
|
+
*/
|
2540
2912
|
zIndex: 3,
|
2541
2913
|
|
2914
|
+
|
2915
|
+
/**
|
2916
|
+
* The background color of the scrollbar itself.
|
2917
|
+
*
|
2918
|
+
* @type {Color}
|
2919
|
+
* @sample {highstock} stock/scrollbar/style/ Scrollbar styling
|
2920
|
+
* @default #cccccc
|
2921
|
+
* @product highstock
|
2922
|
+
*/
|
2542
2923
|
barBackgroundColor: '#cccccc',
|
2924
|
+
|
2925
|
+
/**
|
2926
|
+
* The width of the bar's border.
|
2927
|
+
*
|
2928
|
+
* @type {Number}
|
2929
|
+
* @sample {highstock} stock/scrollbar/style/ Scrollbar styling
|
2930
|
+
* @default 1
|
2931
|
+
* @product highstock
|
2932
|
+
*/
|
2543
2933
|
barBorderWidth: 1,
|
2934
|
+
|
2935
|
+
/**
|
2936
|
+
* The color of the scrollbar's border.
|
2937
|
+
*
|
2938
|
+
* @type {Color}
|
2939
|
+
* @default #cccccc
|
2940
|
+
* @product highstock
|
2941
|
+
*/
|
2544
2942
|
barBorderColor: '#cccccc',
|
2943
|
+
|
2944
|
+
/**
|
2945
|
+
* The color of the small arrow inside the scrollbar buttons.
|
2946
|
+
*
|
2947
|
+
* @type {Color}
|
2948
|
+
* @sample {highstock} stock/scrollbar/style/ Scrollbar styling
|
2949
|
+
* @default #333333
|
2950
|
+
* @product highstock
|
2951
|
+
*/
|
2545
2952
|
buttonArrowColor: '#333333',
|
2953
|
+
|
2954
|
+
/**
|
2955
|
+
* The color of scrollbar buttons.
|
2956
|
+
*
|
2957
|
+
* @type {Color}
|
2958
|
+
* @sample {highstock} stock/scrollbar/style/ Scrollbar styling
|
2959
|
+
* @default #e6e6e6
|
2960
|
+
* @product highstock
|
2961
|
+
*/
|
2546
2962
|
buttonBackgroundColor: '#e6e6e6',
|
2963
|
+
|
2964
|
+
/**
|
2965
|
+
* The color of the border of the scrollbar buttons.
|
2966
|
+
*
|
2967
|
+
* @type {Color}
|
2968
|
+
* @sample {highstock} stock/scrollbar/style/ Scrollbar styling
|
2969
|
+
* @default #cccccc
|
2970
|
+
* @product highstock
|
2971
|
+
*/
|
2547
2972
|
buttonBorderColor: '#cccccc',
|
2973
|
+
|
2974
|
+
/**
|
2975
|
+
* The border width of the scrollbar buttons.
|
2976
|
+
*
|
2977
|
+
* @type {Number}
|
2978
|
+
* @sample {highstock} stock/scrollbar/style/ Scrollbar styling
|
2979
|
+
* @default 1
|
2980
|
+
* @product highstock
|
2981
|
+
*/
|
2548
2982
|
buttonBorderWidth: 1,
|
2983
|
+
|
2984
|
+
/**
|
2985
|
+
* The color of the small rifles in the middle of the scrollbar.
|
2986
|
+
*
|
2987
|
+
* @type {Color}
|
2988
|
+
* @default #333333
|
2989
|
+
* @product highstock
|
2990
|
+
*/
|
2549
2991
|
rifleColor: '#333333',
|
2992
|
+
|
2993
|
+
/**
|
2994
|
+
* The color of the track background.
|
2995
|
+
*
|
2996
|
+
* @type {Color}
|
2997
|
+
* @sample {highstock} stock/scrollbar/style/ Scrollbar styling
|
2998
|
+
* @default #f2f2f2
|
2999
|
+
* @product highstock
|
3000
|
+
*/
|
2550
3001
|
trackBackgroundColor: '#f2f2f2',
|
3002
|
+
|
3003
|
+
/**
|
3004
|
+
* The color of the border of the scrollbar track.
|
3005
|
+
*
|
3006
|
+
* @type {Color}
|
3007
|
+
* @sample {highstock} stock/scrollbar/style/ Scrollbar styling
|
3008
|
+
* @default #f2f2f2
|
3009
|
+
* @product highstock
|
3010
|
+
*/
|
2551
3011
|
trackBorderColor: '#f2f2f2',
|
3012
|
+
|
3013
|
+
/**
|
3014
|
+
* The width of the border of the scrollbar track.
|
3015
|
+
*
|
3016
|
+
* @type {Number}
|
3017
|
+
* @sample {highstock} stock/scrollbar/style/ Scrollbar styling
|
3018
|
+
* @default 1
|
3019
|
+
* @product highstock
|
3020
|
+
*/
|
2552
3021
|
trackBorderWidth: 1
|
2553
3022
|
|
2554
3023
|
};
|
@@ -3070,14 +3539,14 @@
|
|
3070
3539
|
[buttons[buttonsOrder[1]].element, 'click', this.buttonToMaxClick],
|
3071
3540
|
[track, 'click', this.trackClick],
|
3072
3541
|
[bar, 'mousedown', mouseDownHandler],
|
3073
|
-
[
|
3074
|
-
[
|
3542
|
+
[bar.ownerDocument, 'mousemove', mouseMoveHandler],
|
3543
|
+
[bar.ownerDocument, 'mouseup', mouseUpHandler]
|
3075
3544
|
];
|
3076
3545
|
|
3077
3546
|
// Touch events
|
3078
3547
|
if (hasTouch) {
|
3079
3548
|
_events.push(
|
3080
|
-
[bar, 'touchstart', mouseDownHandler], [
|
3549
|
+
[bar, 'touchstart', mouseDownHandler], [bar.ownerDocument, 'touchmove', mouseMoveHandler], [bar.ownerDocument, 'touchend', mouseUpHandler]
|
3081
3550
|
);
|
3082
3551
|
}
|
3083
3552
|
|
@@ -3164,8 +3633,16 @@
|
|
3164
3633
|
*/
|
3165
3634
|
wrap(Axis.prototype, 'render', function(proceed) {
|
3166
3635
|
var axis = this,
|
3167
|
-
scrollMin = Math.min(
|
3168
|
-
|
3636
|
+
scrollMin = Math.min(
|
3637
|
+
pick(axis.options.min, axis.min),
|
3638
|
+
axis.min,
|
3639
|
+
pick(axis.dataMin, axis.min) // #6930
|
3640
|
+
),
|
3641
|
+
scrollMax = Math.max(
|
3642
|
+
pick(axis.options.max, axis.max),
|
3643
|
+
axis.max,
|
3644
|
+
pick(axis.dataMax, axis.max) // #6930
|
3645
|
+
),
|
3169
3646
|
scrollbar = axis.scrollbar,
|
3170
3647
|
titleOffset = axis.titleOffset || 0,
|
3171
3648
|
offsetsIndex,
|
@@ -3269,13 +3746,13 @@
|
|
3269
3746
|
defaultOptions = H.defaultOptions,
|
3270
3747
|
defined = H.defined,
|
3271
3748
|
destroyObjectProperties = H.destroyObjectProperties,
|
3272
|
-
doc = H.doc,
|
3273
3749
|
each = H.each,
|
3274
3750
|
erase = H.erase,
|
3275
3751
|
error = H.error,
|
3276
3752
|
extend = H.extend,
|
3277
3753
|
grep = H.grep,
|
3278
3754
|
hasTouch = H.hasTouch,
|
3755
|
+
isArray = H.isArray,
|
3279
3756
|
isNumber = H.isNumber,
|
3280
3757
|
isObject = H.isObject,
|
3281
3758
|
merge = H.merge,
|
@@ -3307,89 +3784,415 @@
|
|
3307
3784
|
defaultSeriesType = seriesTypes.areaspline === undefined ? 'line' : 'areaspline';
|
3308
3785
|
|
3309
3786
|
extend(defaultOptions, {
|
3787
|
+
|
3788
|
+
/**
|
3789
|
+
* The navigator is a small series below the main series, displaying
|
3790
|
+
* a view of the entire data set. It provides tools to zoom in and
|
3791
|
+
* out on parts of the data as well as panning across the dataset.
|
3792
|
+
*
|
3793
|
+
* @optionparent navigator
|
3794
|
+
* @product highstock
|
3795
|
+
*/
|
3310
3796
|
navigator: {
|
3311
3797
|
//enabled: true,
|
3798
|
+
|
3799
|
+
/**
|
3800
|
+
* The height of the navigator.
|
3801
|
+
*
|
3802
|
+
* @type {Number}
|
3803
|
+
* @sample {highstock} stock/navigator/height/ A higher navigator
|
3804
|
+
* @default 40
|
3805
|
+
* @product highstock
|
3806
|
+
*/
|
3312
3807
|
height: 40,
|
3808
|
+
|
3809
|
+
/**
|
3810
|
+
* The distance from the nearest element, the X axis or X axis labels.
|
3811
|
+
*
|
3812
|
+
* @type {Number}
|
3813
|
+
* @sample {highstock} stock/navigator/margin/ A margin of 2 draws the navigator closer to the X axis labels
|
3814
|
+
* @default 25
|
3815
|
+
* @product highstock
|
3816
|
+
*/
|
3313
3817
|
margin: 25,
|
3818
|
+
|
3819
|
+
/**
|
3820
|
+
* Whether the mask should be inside the range marking the zoomed
|
3821
|
+
* range, or outside. In Highstock 1.x it was always `false`.
|
3822
|
+
*
|
3823
|
+
* @type {Boolean}
|
3824
|
+
* @sample {highstock} stock/navigator/maskinside-false/ False, mask outside
|
3825
|
+
* @default true
|
3826
|
+
* @since 2.0
|
3827
|
+
* @product highstock
|
3828
|
+
*/
|
3314
3829
|
maskInside: true,
|
3315
3830
|
|
3831
|
+
|
3832
|
+
/**
|
3833
|
+
* Options for the handles for dragging the zoomed area. Available
|
3834
|
+
* options are `backgroundColor` (defaults to `#ebe7e8`) and `borderColor`
|
3835
|
+
* (defaults to `#b2b1b6`).
|
3836
|
+
*
|
3837
|
+
* @type {Object}
|
3838
|
+
* @sample {highstock} stock/navigator/handles/ Colored handles
|
3839
|
+
* @sample {highstock} stock/navigator/handles/ Colored handles
|
3840
|
+
* @product highstock
|
3841
|
+
*/
|
3316
3842
|
handles: {
|
3843
|
+
|
3844
|
+
/**
|
3845
|
+
* The fill for the handle.
|
3846
|
+
*
|
3847
|
+
* @type {Color}
|
3848
|
+
* @default #f2f2f2
|
3849
|
+
* @product highstock
|
3850
|
+
*/
|
3317
3851
|
backgroundColor: '#f2f2f2',
|
3852
|
+
|
3853
|
+
/**
|
3854
|
+
* The stroke for the handle border and the stripes inside.
|
3855
|
+
*
|
3856
|
+
* @type {Color}
|
3857
|
+
* @default #999999
|
3858
|
+
* @product highstock
|
3859
|
+
*/
|
3318
3860
|
borderColor: '#999999'
|
3319
3861
|
},
|
3862
|
+
|
3863
|
+
/**
|
3864
|
+
* The color of the mask covering the areas of the navigator series
|
3865
|
+
* that are currently not visible in the main series. The default
|
3866
|
+
* color is bluish with an opacity of 0.3 to see the series below.
|
3867
|
+
*
|
3868
|
+
* @type {Color}
|
3869
|
+
* @see In [styled mode](http://www.highcharts.com/docs/chart-design-and-
|
3870
|
+
* style/style-by-css), the mask is styled with the `.highcharts-navigator-
|
3871
|
+
* mask` and `.highcharts-navigator-mask-inside` classes.
|
3872
|
+
* @sample {highstock} stock/navigator/maskfill/ Blue, semi transparent mask
|
3873
|
+
* @default rgba(102,133,194,0.3)
|
3874
|
+
* @product highstock
|
3875
|
+
*/
|
3320
3876
|
maskFill: color('#6685c2').setOpacity(0.3).get(),
|
3877
|
+
|
3878
|
+
/**
|
3879
|
+
* The color of the line marking the currently zoomed area in the
|
3880
|
+
* navigator.
|
3881
|
+
*
|
3882
|
+
* @type {Color}
|
3883
|
+
* @sample {highstock} stock/navigator/outline/ 2px blue outline
|
3884
|
+
* @default #cccccc
|
3885
|
+
* @product highstock
|
3886
|
+
*/
|
3321
3887
|
outlineColor: '#cccccc',
|
3888
|
+
|
3889
|
+
/**
|
3890
|
+
* The width of the line marking the currently zoomed area in the
|
3891
|
+
* navigator.
|
3892
|
+
*
|
3893
|
+
* @type {Number}
|
3894
|
+
* @see In [styled mode](http://www.highcharts.com/docs/chart-design-and-
|
3895
|
+
* style/style-by-css), the outline stroke width is set with the `.
|
3896
|
+
* highcharts-navigator-outline` class.
|
3897
|
+
* @sample {highstock} stock/navigator/outline/ 2px blue outline
|
3898
|
+
* @default 2
|
3899
|
+
* @product highstock
|
3900
|
+
*/
|
3322
3901
|
outlineWidth: 1,
|
3323
3902
|
|
3903
|
+
|
3904
|
+
/**
|
3905
|
+
* Options for the navigator series. Available options are the same
|
3906
|
+
* as any series, documented at [plotOptions](#plotOptions.series)
|
3907
|
+
* and [series](#series).
|
3908
|
+
*
|
3909
|
+
* Unless data is explicitly defined on navigator.series, the data
|
3910
|
+
* is borrowed from the first series in the chart.
|
3911
|
+
*
|
3912
|
+
* Default series options for the navigator series are:
|
3913
|
+
*
|
3914
|
+
* <pre>series: {
|
3915
|
+
* type: 'areaspline',
|
3916
|
+
* color: '#4572A7',
|
3917
|
+
* fillOpacity: 0.05,
|
3918
|
+
* dataGrouping: {
|
3919
|
+
* smoothed: true
|
3920
|
+
* },
|
3921
|
+
* lineWidth: 1,
|
3922
|
+
* marker: {
|
3923
|
+
* enabled: false
|
3924
|
+
* }
|
3925
|
+
* }</pre>
|
3926
|
+
*
|
3927
|
+
* @type {Object}
|
3928
|
+
* @see In [styled mode](http://www.highcharts.com/docs/chart-design-and-
|
3929
|
+
* style/style-by-css), the navigator series is styled with the `.
|
3930
|
+
* highcharts-navigator-series` class.
|
3931
|
+
* @sample {highstock} stock/navigator/series-data/ Using a separate data set for the navigator
|
3932
|
+
* @sample {highstock} stock/navigator/series/ A green navigator series
|
3933
|
+
* @product highstock
|
3934
|
+
*/
|
3324
3935
|
series: {
|
3936
|
+
|
3937
|
+
/**
|
3938
|
+
*/
|
3325
3939
|
type: defaultSeriesType,
|
3326
3940
|
|
3941
|
+
|
3942
|
+
/**
|
3943
|
+
*/
|
3327
3944
|
color: '#335cad',
|
3945
|
+
|
3946
|
+
/**
|
3947
|
+
*/
|
3328
3948
|
fillOpacity: 0.05,
|
3949
|
+
|
3950
|
+
/**
|
3951
|
+
*/
|
3329
3952
|
lineWidth: 1,
|
3330
3953
|
|
3954
|
+
|
3955
|
+
/**
|
3956
|
+
*/
|
3331
3957
|
compare: null,
|
3958
|
+
|
3959
|
+
/**
|
3960
|
+
*/
|
3332
3961
|
dataGrouping: {
|
3962
|
+
|
3963
|
+
/**
|
3964
|
+
*/
|
3333
3965
|
approximation: 'average',
|
3966
|
+
|
3967
|
+
/**
|
3968
|
+
*/
|
3334
3969
|
enabled: true,
|
3970
|
+
|
3971
|
+
/**
|
3972
|
+
*/
|
3335
3973
|
groupPixelWidth: 2,
|
3974
|
+
|
3975
|
+
/**
|
3976
|
+
*/
|
3336
3977
|
smoothed: true,
|
3978
|
+
|
3979
|
+
/**
|
3980
|
+
*/
|
3337
3981
|
units: units
|
3338
3982
|
},
|
3983
|
+
|
3984
|
+
/**
|
3985
|
+
*/
|
3339
3986
|
dataLabels: {
|
3987
|
+
|
3988
|
+
/**
|
3989
|
+
*/
|
3340
3990
|
enabled: false,
|
3991
|
+
|
3992
|
+
/**
|
3993
|
+
*/
|
3341
3994
|
zIndex: 2 // #1839
|
3342
3995
|
},
|
3996
|
+
|
3997
|
+
/**
|
3998
|
+
*/
|
3343
3999
|
id: 'highcharts-navigator-series',
|
4000
|
+
|
4001
|
+
/**
|
4002
|
+
*/
|
3344
4003
|
className: 'highcharts-navigator-series',
|
4004
|
+
|
4005
|
+
/**
|
4006
|
+
*/
|
3345
4007
|
lineColor: null, // Allow color setting while disallowing default candlestick setting (#4602)
|
4008
|
+
|
4009
|
+
/**
|
4010
|
+
*/
|
3346
4011
|
marker: {
|
4012
|
+
|
4013
|
+
/**
|
4014
|
+
*/
|
3347
4015
|
enabled: false
|
3348
4016
|
},
|
4017
|
+
|
4018
|
+
/**
|
4019
|
+
*/
|
3349
4020
|
pointRange: 0,
|
4021
|
+
|
4022
|
+
/**
|
4023
|
+
*/
|
3350
4024
|
shadow: false,
|
4025
|
+
|
4026
|
+
/**
|
4027
|
+
*/
|
3351
4028
|
threshold: null
|
3352
4029
|
},
|
3353
4030
|
//top: undefined,
|
3354
4031
|
//opposite: undefined,
|
4032
|
+
|
4033
|
+
/**
|
4034
|
+
* Options for the navigator X axis. Available options are the same
|
4035
|
+
* as any X axis, documented at [xAxis](#xAxis). Default series options
|
4036
|
+
* for the navigator xAxis are:
|
4037
|
+
*
|
4038
|
+
* <pre>xAxis: {
|
4039
|
+
* tickWidth: 0,
|
4040
|
+
* lineWidth: 0,
|
4041
|
+
* gridLineWidth: 1,
|
4042
|
+
* tickPixelInterval: 200,
|
4043
|
+
* labels: {
|
4044
|
+
* align: 'left',
|
4045
|
+
* style: {
|
4046
|
+
* color: '#888'
|
4047
|
+
* },
|
4048
|
+
* x: 3,
|
4049
|
+
* y: -4
|
4050
|
+
* }
|
4051
|
+
* }</pre>
|
4052
|
+
*
|
4053
|
+
* @type {Object}
|
4054
|
+
* @product highstock
|
4055
|
+
*/
|
3355
4056
|
xAxis: {
|
4057
|
+
|
4058
|
+
/**
|
4059
|
+
*/
|
3356
4060
|
className: 'highcharts-navigator-xaxis',
|
4061
|
+
|
4062
|
+
/**
|
4063
|
+
*/
|
3357
4064
|
tickLength: 0,
|
3358
4065
|
|
4066
|
+
|
4067
|
+
/**
|
4068
|
+
*/
|
3359
4069
|
lineWidth: 0,
|
4070
|
+
|
4071
|
+
/**
|
4072
|
+
*/
|
3360
4073
|
gridLineColor: '#e6e6e6',
|
4074
|
+
|
4075
|
+
/**
|
4076
|
+
*/
|
3361
4077
|
gridLineWidth: 1,
|
3362
4078
|
|
4079
|
+
|
4080
|
+
/**
|
4081
|
+
*/
|
3363
4082
|
tickPixelInterval: 200,
|
4083
|
+
|
4084
|
+
/**
|
4085
|
+
*/
|
3364
4086
|
labels: {
|
4087
|
+
|
4088
|
+
/**
|
4089
|
+
*/
|
3365
4090
|
align: 'left',
|
3366
4091
|
|
4092
|
+
|
4093
|
+
/**
|
4094
|
+
*/
|
3367
4095
|
style: {
|
4096
|
+
|
4097
|
+
/**
|
4098
|
+
*/
|
3368
4099
|
color: '#999999'
|
3369
4100
|
},
|
3370
4101
|
|
4102
|
+
|
4103
|
+
/**
|
4104
|
+
*/
|
3371
4105
|
x: 3,
|
4106
|
+
|
4107
|
+
/**
|
4108
|
+
*/
|
3372
4109
|
y: -4
|
3373
4110
|
},
|
4111
|
+
|
4112
|
+
/**
|
4113
|
+
*/
|
3374
4114
|
crosshair: false
|
3375
4115
|
},
|
4116
|
+
|
4117
|
+
/**
|
4118
|
+
* Options for the navigator Y axis. Available options are the same
|
4119
|
+
* as any y axis, documented at [yAxis](#yAxis). Default series options
|
4120
|
+
* for the navigator yAxis are:
|
4121
|
+
*
|
4122
|
+
* <pre>yAxis: {
|
4123
|
+
* gridLineWidth: 0,
|
4124
|
+
* startOnTick: false,
|
4125
|
+
* endOnTick: false,
|
4126
|
+
* minPadding: 0.1,
|
4127
|
+
* maxPadding: 0.1,
|
4128
|
+
* labels: {
|
4129
|
+
* enabled: false
|
4130
|
+
* },
|
4131
|
+
* title: {
|
4132
|
+
* text: null
|
4133
|
+
* },
|
4134
|
+
* tickWidth: 0
|
4135
|
+
* }</pre>
|
4136
|
+
*
|
4137
|
+
* @type {Object}
|
4138
|
+
* @product highstock
|
4139
|
+
*/
|
3376
4140
|
yAxis: {
|
4141
|
+
|
4142
|
+
/**
|
4143
|
+
*/
|
3377
4144
|
className: 'highcharts-navigator-yaxis',
|
3378
4145
|
|
4146
|
+
|
4147
|
+
/**
|
4148
|
+
*/
|
3379
4149
|
gridLineWidth: 0,
|
3380
4150
|
|
4151
|
+
|
4152
|
+
/**
|
4153
|
+
*/
|
3381
4154
|
startOnTick: false,
|
4155
|
+
|
4156
|
+
/**
|
4157
|
+
*/
|
3382
4158
|
endOnTick: false,
|
4159
|
+
|
4160
|
+
/**
|
4161
|
+
*/
|
3383
4162
|
minPadding: 0.1,
|
4163
|
+
|
4164
|
+
/**
|
4165
|
+
*/
|
3384
4166
|
maxPadding: 0.1,
|
4167
|
+
|
4168
|
+
/**
|
4169
|
+
*/
|
3385
4170
|
labels: {
|
4171
|
+
|
4172
|
+
/**
|
4173
|
+
*/
|
3386
4174
|
enabled: false
|
3387
4175
|
},
|
4176
|
+
|
4177
|
+
/**
|
4178
|
+
*/
|
3388
4179
|
crosshair: false,
|
4180
|
+
|
4181
|
+
/**
|
4182
|
+
*/
|
3389
4183
|
title: {
|
4184
|
+
|
4185
|
+
/**
|
4186
|
+
*/
|
3390
4187
|
text: null
|
3391
4188
|
},
|
4189
|
+
|
4190
|
+
/**
|
4191
|
+
*/
|
3392
4192
|
tickLength: 0,
|
4193
|
+
|
4194
|
+
/**
|
4195
|
+
*/
|
3393
4196
|
tickWidth: 0
|
3394
4197
|
}
|
3395
4198
|
}
|
@@ -3673,6 +4476,13 @@
|
|
3673
4476
|
* @param {Object} options Options to merge in when updating navigator
|
3674
4477
|
*/
|
3675
4478
|
update: function(options) {
|
4479
|
+
// Remove references to old navigator series in base series
|
4480
|
+
each(this.series || [], function(series) {
|
4481
|
+
if (series.baseSeries) {
|
4482
|
+
delete series.baseSeries.navigatorSeries;
|
4483
|
+
}
|
4484
|
+
});
|
4485
|
+
// Destroy and rebuild navigator
|
3676
4486
|
this.destroy();
|
3677
4487
|
var chartOptions = this.chart.options;
|
3678
4488
|
merge(true, chartOptions.navigator, this.options, options);
|
@@ -3853,14 +4663,14 @@
|
|
3853
4663
|
// because Navigator.grabbedSomething flags are stored in mousedown events:
|
3854
4664
|
eventsToUnbind.push(
|
3855
4665
|
addEvent(container, 'mousemove', mouseMoveHandler),
|
3856
|
-
addEvent(
|
4666
|
+
addEvent(container.ownerDocument, 'mouseup', mouseUpHandler)
|
3857
4667
|
);
|
3858
4668
|
|
3859
4669
|
// Touch events
|
3860
4670
|
if (hasTouch) {
|
3861
4671
|
eventsToUnbind.push(
|
3862
4672
|
addEvent(container, 'touchmove', mouseMoveHandler),
|
3863
|
-
addEvent(
|
4673
|
+
addEvent(container.ownerDocument, 'touchend', mouseUpHandler)
|
3864
4674
|
);
|
3865
4675
|
eventsToUnbind.concat(navigator.getPartsEvents('touchstart'));
|
3866
4676
|
}
|
@@ -4143,10 +4953,12 @@
|
|
4143
4953
|
*/
|
4144
4954
|
removeBaseSeriesEvents: function() {
|
4145
4955
|
var baseSeries = this.baseSeries || [];
|
4146
|
-
if (this.navigatorEnabled && baseSeries[0]
|
4147
|
-
|
4148
|
-
|
4149
|
-
|
4956
|
+
if (this.navigatorEnabled && baseSeries[0]) {
|
4957
|
+
if (this.navigatorOptions.adaptToUpdatedData !== false) {
|
4958
|
+
each(baseSeries, function(series) {
|
4959
|
+
removeEvent(series, 'updatedData', this.updatedDataHandler);
|
4960
|
+
}, this);
|
4961
|
+
}
|
4150
4962
|
|
4151
4963
|
// We only listen for extremes-events on the first baseSeries
|
4152
4964
|
if (baseSeries[0].xAxis) {
|
@@ -4240,7 +5052,7 @@
|
|
4240
5052
|
|
4241
5053
|
// If we have a base series, initialize the navigator series
|
4242
5054
|
if (baseSeries || navigatorOptions.series.data) {
|
4243
|
-
navigator.
|
5055
|
+
navigator.updateNavigatorSeries();
|
4244
5056
|
|
4245
5057
|
// If not, set up an event to listen for added series
|
4246
5058
|
} else if (chart.series.length === 0) {
|
@@ -4360,55 +5172,55 @@
|
|
4360
5172
|
},
|
4361
5173
|
|
4362
5174
|
/**
|
4363
|
-
* Set the base series
|
4364
|
-
* this an API method to be called
|
4365
|
-
*
|
5175
|
+
* Set the base series and update the navigator series from this. With a bit
|
5176
|
+
* of modification we should be able to make this an API method to be called
|
5177
|
+
* from the outside
|
5178
|
+
* @param {Object} baseSeriesOptions - additional series options for a navigator
|
4366
5179
|
*/
|
4367
5180
|
setBaseSeries: function(baseSeriesOptions) {
|
4368
5181
|
var chart = this.chart,
|
4369
|
-
baseSeries;
|
5182
|
+
baseSeries = this.baseSeries = [];
|
4370
5183
|
|
4371
5184
|
baseSeriesOptions = baseSeriesOptions || chart.options && chart.options.navigator.baseSeries || 0;
|
4372
5185
|
|
4373
|
-
//
|
4374
|
-
if (this.series) {
|
4375
|
-
this.removeBaseSeriesEvents();
|
4376
|
-
each(this.series, function(s) {
|
4377
|
-
s.destroy();
|
4378
|
-
});
|
4379
|
-
}
|
4380
|
-
|
4381
|
-
baseSeries = this.baseSeries = [];
|
4382
|
-
|
4383
|
-
// Iterate through series and add the ones that should be shown in navigator
|
5186
|
+
// Iterate through series and add the ones that should be shown in navigator.
|
4384
5187
|
each(chart.series || [], function(series, i) {
|
4385
|
-
if (series.options.
|
4386
|
-
|
5188
|
+
if (!series.options.isInternal && // Don't include existing nav series
|
5189
|
+
(
|
5190
|
+
series.options.showInNavigator ||
|
5191
|
+
(
|
5192
|
+
i === baseSeriesOptions ||
|
5193
|
+
series.options.id === baseSeriesOptions
|
5194
|
+
) &&
|
5195
|
+
series.options.showInNavigator !== false
|
5196
|
+
)
|
5197
|
+
) {
|
4387
5198
|
baseSeries.push(series);
|
4388
5199
|
}
|
4389
5200
|
});
|
4390
5201
|
|
4391
5202
|
// When run after render, this.xAxis already exists
|
4392
5203
|
if (this.xAxis && !this.xAxis.fake) {
|
4393
|
-
this.
|
5204
|
+
this.updateNavigatorSeries();
|
4394
5205
|
}
|
4395
5206
|
},
|
4396
5207
|
|
4397
5208
|
/*
|
4398
|
-
*
|
5209
|
+
* Update series in the navigator from baseSeries, adding new if does not
|
5210
|
+
* exist.
|
4399
5211
|
*/
|
4400
|
-
|
5212
|
+
updateNavigatorSeries: function() {
|
4401
5213
|
var navigator = this,
|
4402
5214
|
chart = navigator.chart,
|
4403
|
-
navigatorSeries = navigator.series = [],
|
4404
5215
|
baseSeries = navigator.baseSeries,
|
4405
5216
|
baseOptions,
|
4406
5217
|
mergedNavSeriesOptions,
|
4407
|
-
|
5218
|
+
chartNavigatorSeriesOptions = navigator.navigatorOptions.series,
|
4408
5219
|
baseNavigatorOptions,
|
4409
5220
|
navSeriesMixin = {
|
4410
5221
|
enableMouseTracking: false,
|
4411
5222
|
index: null, // #6162
|
5223
|
+
linkedTo: null, // #6734
|
4412
5224
|
group: 'nav', // for columns
|
4413
5225
|
padXAxis: false,
|
4414
5226
|
xAxis: 'navigator-x-axis',
|
@@ -4417,32 +5229,108 @@
|
|
4417
5229
|
stacking: false, // #4823
|
4418
5230
|
isInternal: true,
|
4419
5231
|
visible: true
|
4420
|
-
}
|
5232
|
+
},
|
5233
|
+
// Remove navigator series that are no longer in the baseSeries
|
5234
|
+
navigatorSeries = navigator.series = H.grep(
|
5235
|
+
navigator.series || [],
|
5236
|
+
function(navSeries) {
|
5237
|
+
var base = navSeries.baseSeries;
|
5238
|
+
if (H.inArray(base, baseSeries) < 0) { // Not in array
|
5239
|
+
// If there is still a base series connected to this series,
|
5240
|
+
// remove event handler and reference.
|
5241
|
+
if (base) {
|
5242
|
+
removeEvent(
|
5243
|
+
base,
|
5244
|
+
'updatedData',
|
5245
|
+
navigator.updatedDataHandler
|
5246
|
+
);
|
5247
|
+
delete base.navigatorSeries;
|
5248
|
+
}
|
5249
|
+
// Kill the nav series
|
5250
|
+
navSeries.destroy();
|
5251
|
+
return false;
|
5252
|
+
}
|
5253
|
+
return true;
|
5254
|
+
}
|
5255
|
+
);
|
4421
5256
|
|
4422
5257
|
// Go through each base series and merge the options to create new series
|
4423
|
-
if (baseSeries) {
|
5258
|
+
if (baseSeries && baseSeries.length) {
|
4424
5259
|
each(baseSeries, function(base, i) {
|
5260
|
+
var linkedNavSeries = base.navigatorSeries,
|
5261
|
+
userNavOptions = !isArray(chartNavigatorSeriesOptions) ?
|
5262
|
+
chartNavigatorSeriesOptions : {};
|
5263
|
+
|
5264
|
+
// Don't update if the series exists in nav and we have disabled
|
5265
|
+
// adaptToUpdatedData.
|
5266
|
+
if (
|
5267
|
+
linkedNavSeries &&
|
5268
|
+
navigator.navigatorOptions.adaptToUpdatedData === false
|
5269
|
+
) {
|
5270
|
+
return;
|
5271
|
+
}
|
5272
|
+
|
4425
5273
|
navSeriesMixin.name = 'Navigator ' + (i + 1);
|
4426
5274
|
|
4427
5275
|
baseOptions = base.options || {};
|
4428
5276
|
baseNavigatorOptions = baseOptions.navigatorOptions || {};
|
4429
|
-
mergedNavSeriesOptions = merge(
|
5277
|
+
mergedNavSeriesOptions = merge(
|
5278
|
+
baseOptions,
|
5279
|
+
navSeriesMixin,
|
5280
|
+
userNavOptions,
|
5281
|
+
baseNavigatorOptions
|
5282
|
+
);
|
4430
5283
|
|
4431
5284
|
// Merge data separately. Do a slice to avoid mutating the navigator options from base series (#4923).
|
4432
|
-
var navigatorSeriesData = baseNavigatorOptions.data ||
|
5285
|
+
var navigatorSeriesData = baseNavigatorOptions.data || userNavOptions.data;
|
4433
5286
|
navigator.hasNavigatorData = navigator.hasNavigatorData || !!navigatorSeriesData;
|
4434
5287
|
mergedNavSeriesOptions.data = navigatorSeriesData || baseOptions.data && baseOptions.data.slice(0);
|
4435
5288
|
|
4436
|
-
//
|
4437
|
-
|
4438
|
-
|
5289
|
+
// Update or add the series
|
5290
|
+
if (linkedNavSeries) {
|
5291
|
+
linkedNavSeries.update(mergedNavSeriesOptions);
|
5292
|
+
} else {
|
5293
|
+
base.navigatorSeries = chart.initSeries(mergedNavSeriesOptions);
|
5294
|
+
base.navigatorSeries.baseSeries = base; // Store ref
|
5295
|
+
navigatorSeries.push(base.navigatorSeries);
|
5296
|
+
}
|
5297
|
+
});
|
5298
|
+
}
|
5299
|
+
|
5300
|
+
// If user has defined data (and no base series) or explicitly defined
|
5301
|
+
// navigator.series as an array, we create these series on top of any
|
5302
|
+
// base series.
|
5303
|
+
if (
|
5304
|
+
chartNavigatorSeriesOptions.data &&
|
5305
|
+
!(baseSeries && baseSeries.length) ||
|
5306
|
+
isArray(chartNavigatorSeriesOptions)
|
5307
|
+
) {
|
5308
|
+
navigator.hasNavigatorData = false;
|
5309
|
+
// Allow navigator.series to be an array
|
5310
|
+
chartNavigatorSeriesOptions = H.splat(chartNavigatorSeriesOptions);
|
5311
|
+
each(chartNavigatorSeriesOptions, function(userSeriesOptions, i) {
|
5312
|
+
mergedNavSeriesOptions = merge({
|
5313
|
+
// Since we don't have a base series to pull color from,
|
5314
|
+
// try to fake it by using color from series with same
|
5315
|
+
// index. Otherwise pull from the colors array. We need
|
5316
|
+
// an explicit color as otherwise updates will increment
|
5317
|
+
// color counter and we'll get a new color for each
|
5318
|
+
// update of the nav series.
|
5319
|
+
color: chart.series[i] &&
|
5320
|
+
!chart.series[i].options.isInternal &&
|
5321
|
+
chart.series[i].color ||
|
5322
|
+
chart.options.colors[i] ||
|
5323
|
+
chart.options.colors[0]
|
5324
|
+
},
|
5325
|
+
userSeriesOptions,
|
5326
|
+
navSeriesMixin
|
5327
|
+
);
|
5328
|
+
mergedNavSeriesOptions.data = userSeriesOptions.data;
|
5329
|
+
if (mergedNavSeriesOptions.data) {
|
5330
|
+
navigator.hasNavigatorData = true;
|
5331
|
+
navigatorSeries.push(chart.initSeries(mergedNavSeriesOptions));
|
5332
|
+
}
|
4439
5333
|
});
|
4440
|
-
} else {
|
4441
|
-
// No base series, build from mixin and chart wide options
|
4442
|
-
mergedNavSeriesOptions = merge(chartNavigatorOptions, navSeriesMixin);
|
4443
|
-
mergedNavSeriesOptions.data = chartNavigatorOptions.data;
|
4444
|
-
navigator.hasNavigatorData = !!mergedNavSeriesOptions.data;
|
4445
|
-
navigatorSeries.push(chart.initSeries(mergedNavSeriesOptions));
|
4446
5334
|
}
|
4447
5335
|
|
4448
5336
|
this.addBaseSeriesEvents();
|
@@ -4456,29 +5344,44 @@
|
|
4456
5344
|
var navigator = this,
|
4457
5345
|
baseSeries = navigator.baseSeries || [];
|
4458
5346
|
|
4459
|
-
// Bind modified extremes event to first base's xAxis only.
|
5347
|
+
// Bind modified extremes event to first base's xAxis only.
|
5348
|
+
// In event of > 1 base-xAxes, the navigator will ignore those.
|
5349
|
+
// Adding this multiple times to the same axis is no problem, as
|
5350
|
+
// duplicates should be discarded by the browser.
|
4460
5351
|
if (baseSeries[0] && baseSeries[0].xAxis) {
|
4461
5352
|
addEvent(baseSeries[0].xAxis, 'foundExtremes', this.modifyBaseAxisExtremes);
|
4462
5353
|
}
|
4463
5354
|
|
4464
|
-
|
4465
|
-
//
|
4466
|
-
|
4467
|
-
|
5355
|
+
each(baseSeries, function(base) {
|
5356
|
+
// Link base series show/hide to navigator series visibility
|
5357
|
+
addEvent(base, 'show', function() {
|
5358
|
+
if (this.navigatorSeries) {
|
5359
|
+
this.navigatorSeries.show();
|
5360
|
+
}
|
5361
|
+
});
|
5362
|
+
addEvent(base, 'hide', function() {
|
5363
|
+
if (this.navigatorSeries) {
|
5364
|
+
this.navigatorSeries.hide();
|
5365
|
+
}
|
5366
|
+
});
|
5367
|
+
|
5368
|
+
// Respond to updated data in the base series, unless explicitily
|
5369
|
+
// not adapting to data changes.
|
5370
|
+
if (this.navigatorOptions.adaptToUpdatedData !== false) {
|
4468
5371
|
if (base.xAxis) {
|
4469
5372
|
addEvent(base, 'updatedData', this.updatedDataHandler);
|
4470
5373
|
}
|
5374
|
+
}
|
4471
5375
|
|
4472
|
-
|
4473
|
-
|
4474
|
-
|
4475
|
-
|
4476
|
-
|
4477
|
-
|
4478
|
-
|
4479
|
-
|
4480
|
-
|
4481
|
-
}
|
5376
|
+
// Handle series removal
|
5377
|
+
addEvent(base, 'remove', function() {
|
5378
|
+
if (this.navigatorSeries) {
|
5379
|
+
erase(navigator.series, this.navigatorSeries);
|
5380
|
+
this.navigatorSeries.remove(false);
|
5381
|
+
delete this.navigatorSeries;
|
5382
|
+
}
|
5383
|
+
});
|
5384
|
+
}, this);
|
4482
5385
|
},
|
4483
5386
|
|
4484
5387
|
/**
|
@@ -4567,13 +5470,16 @@
|
|
4567
5470
|
baseSeries = this,
|
4568
5471
|
navigatorSeries = this.navigatorSeries;
|
4569
5472
|
|
4570
|
-
// Detect whether the zoomed area should stick to the minimum or maximum. If the current
|
4571
|
-
// axis minimum falls outside the new updated dataset, we must adjust.
|
4572
|
-
navigator.stickToMin = isNumber(baseSeries.xAxis.min) && (baseSeries.xAxis.min <= baseSeries.xData[0]);
|
4573
5473
|
// If the scrollbar is scrolled all the way to the right, keep right as new data
|
4574
5474
|
// comes in.
|
4575
5475
|
navigator.stickToMax = Math.round(navigator.zoomedMax) >= Math.round(navigator.size);
|
4576
5476
|
|
5477
|
+
// Detect whether the zoomed area should stick to the minimum or maximum. If the current
|
5478
|
+
// axis minimum falls outside the new updated dataset, we must adjust.
|
5479
|
+
navigator.stickToMin = isNumber(baseSeries.xAxis.min) &&
|
5480
|
+
(baseSeries.xAxis.min <= baseSeries.xData[0]) &&
|
5481
|
+
(!this.chart.fixedRange || !navigator.stickToMax);
|
5482
|
+
|
4577
5483
|
// Set the navigator series data to the new data of the base series
|
4578
5484
|
if (navigatorSeries && !navigator.hasNavigatorData) {
|
4579
5485
|
navigatorSeries.options.pointStart = baseSeries.xData[0];
|
@@ -4775,7 +5681,7 @@
|
|
4775
5681
|
// Handle updating series
|
4776
5682
|
wrap(Series.prototype, 'update', function(proceed, newOptions, redraw) {
|
4777
5683
|
proceed.call(this, newOptions, false);
|
4778
|
-
if (this.chart.navigator) {
|
5684
|
+
if (this.chart.navigator && !this.options.isInternal) {
|
4779
5685
|
this.chart.navigator.setBaseSeries();
|
4780
5686
|
}
|
4781
5687
|
if (pick(redraw, true)) {
|
@@ -4831,20 +5737,88 @@
|
|
4831
5737
|
* Start Range Selector code *
|
4832
5738
|
*****************************************************************************/
|
4833
5739
|
extend(defaultOptions, {
|
5740
|
+
|
5741
|
+
/**
|
5742
|
+
* The range selector is a tool for selecting ranges to display within
|
5743
|
+
* the chart. It provides buttons to select preconfigured ranges in
|
5744
|
+
* the chart, like 1 day, 1 week, 1 month etc. It also provides input
|
5745
|
+
* boxes where min and max dates can be manually input.
|
5746
|
+
*
|
5747
|
+
* @optionparent rangeSelector
|
5748
|
+
* @product highstock
|
5749
|
+
*/
|
4834
5750
|
rangeSelector: {
|
4835
5751
|
// allButtonsEnabled: false,
|
4836
5752
|
// enabled: true,
|
4837
5753
|
// buttons: {Object}
|
4838
5754
|
// buttonSpacing: 0,
|
5755
|
+
|
5756
|
+
/**
|
5757
|
+
* A collection of attributes for the buttons. The object takes SVG
|
5758
|
+
* attributes like `fill`, `stroke`, `stroke-width`, as well as `style`,
|
5759
|
+
* a collection of CSS properties for the text.
|
5760
|
+
*
|
5761
|
+
* The object can also be extended with states, so you can set presentational
|
5762
|
+
* options for `hover`, `select` or `disabled` button states.
|
5763
|
+
*
|
5764
|
+
* CSS styles for the text label.
|
5765
|
+
*
|
5766
|
+
* In [styled mode](http://www.highcharts.com/docs/chart-design-and-
|
5767
|
+
* style/style-by-css), the buttons are styled by the `.highcharts-
|
5768
|
+
* range-selector-buttons .highcharts-button` rule with its different
|
5769
|
+
* states.
|
5770
|
+
*
|
5771
|
+
* @type {Object}
|
5772
|
+
* @sample {highstock} stock/rangeselector/styling/ Styling the buttons and inputs
|
5773
|
+
* @product highstock
|
5774
|
+
*/
|
4839
5775
|
buttonTheme: {
|
5776
|
+
|
5777
|
+
/**
|
5778
|
+
*/
|
4840
5779
|
'stroke-width': 0,
|
5780
|
+
|
5781
|
+
/**
|
5782
|
+
*/
|
4841
5783
|
width: 28,
|
5784
|
+
|
5785
|
+
/**
|
5786
|
+
*/
|
4842
5787
|
height: 18,
|
5788
|
+
|
5789
|
+
/**
|
5790
|
+
*/
|
4843
5791
|
padding: 2,
|
5792
|
+
|
5793
|
+
/**
|
5794
|
+
*/
|
4844
5795
|
zIndex: 7 // #484, #852
|
4845
5796
|
},
|
5797
|
+
|
5798
|
+
/**
|
5799
|
+
* The height of the range selector, used to reserve space for buttons
|
5800
|
+
* and input.
|
5801
|
+
*
|
5802
|
+
* @type {Number}
|
5803
|
+
* @default 35
|
5804
|
+
* @since 2.1.9
|
5805
|
+
* @product highstock
|
5806
|
+
*/
|
4846
5807
|
height: 35, // reserved space for buttons and input
|
5808
|
+
|
5809
|
+
/**
|
5810
|
+
* Positioning for the input boxes. Allowed properties are `align`,
|
5811
|
+
* `verticalAlign`, `x` and `y`.
|
5812
|
+
*
|
5813
|
+
* @type {Object}
|
5814
|
+
* @default { align: "right" }
|
5815
|
+
* @since 1.2.5
|
5816
|
+
* @product highstock
|
5817
|
+
*/
|
4847
5818
|
inputPosition: {
|
5819
|
+
|
5820
|
+
/**
|
5821
|
+
*/
|
4848
5822
|
align: 'right'
|
4849
5823
|
},
|
4850
5824
|
// inputDateFormat: '%b %e, %Y',
|
@@ -4853,17 +5827,79 @@
|
|
4853
5827
|
// selected: undefined,
|
4854
5828
|
|
4855
5829
|
// inputStyle: {},
|
5830
|
+
|
5831
|
+
/**
|
5832
|
+
* CSS styles for the labels - the Zoom, From and To texts.
|
5833
|
+
*
|
5834
|
+
* In [styled mode](http://www.highcharts.com/docs/chart-design-and-
|
5835
|
+
* style/style-by-css), the labels are styled by the `.highcharts-
|
5836
|
+
* range-label` class.
|
5837
|
+
*
|
5838
|
+
* @type {CSSObject}
|
5839
|
+
* @sample {highstock} stock/rangeselector/styling/ Styling the buttons and inputs
|
5840
|
+
* @product highstock
|
5841
|
+
*/
|
4856
5842
|
labelStyle: {
|
5843
|
+
|
5844
|
+
/**
|
5845
|
+
*/
|
4857
5846
|
color: '#666666'
|
4858
5847
|
}
|
4859
5848
|
|
4860
5849
|
}
|
4861
5850
|
});
|
4862
|
-
|
4863
|
-
|
4864
|
-
|
4865
|
-
|
4866
|
-
|
5851
|
+
|
5852
|
+
defaultOptions.lang = merge(
|
5853
|
+
defaultOptions.lang,
|
5854
|
+
/**
|
5855
|
+
* Language object. The language object is global and it can't be set
|
5856
|
+
* on each chart initiation. Instead, use `Highcharts.setOptions` to
|
5857
|
+
* set it before any chart is initialized.
|
5858
|
+
*
|
5859
|
+
* <pre>Highcharts.setOptions({
|
5860
|
+
* lang: {
|
5861
|
+
* months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin',
|
5862
|
+
* 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
|
5863
|
+
*
|
5864
|
+
* weekdays: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi',
|
5865
|
+
* 'Samedi']
|
5866
|
+
* }
|
5867
|
+
* });</pre>
|
5868
|
+
*
|
5869
|
+
* @optionparent lang
|
5870
|
+
* @product highstock
|
5871
|
+
*/
|
5872
|
+
{
|
5873
|
+
|
5874
|
+
/**
|
5875
|
+
* The text for the label for the range selector buttons.
|
5876
|
+
*
|
5877
|
+
* @type {String}
|
5878
|
+
* @default Zoom
|
5879
|
+
* @product highstock
|
5880
|
+
*/
|
5881
|
+
rangeSelectorZoom: 'Zoom',
|
5882
|
+
|
5883
|
+
/**
|
5884
|
+
* The text for the label for the "from" input box in the range
|
5885
|
+
* selector.
|
5886
|
+
*
|
5887
|
+
* @type {String}
|
5888
|
+
* @default From
|
5889
|
+
* @product highstock
|
5890
|
+
*/
|
5891
|
+
rangeSelectorFrom: 'From',
|
5892
|
+
|
5893
|
+
/**
|
5894
|
+
* The text for the label for the "to" input box in the range selector.
|
5895
|
+
*
|
5896
|
+
* @type {String}
|
5897
|
+
* @default To
|
5898
|
+
* @product highstock
|
5899
|
+
*/
|
5900
|
+
rangeSelectorTo: 'To'
|
5901
|
+
}
|
5902
|
+
);
|
4867
5903
|
|
4868
5904
|
/**
|
4869
5905
|
* The range selector.
|
@@ -5814,7 +6850,7 @@
|
|
5814
6850
|
* @param {Function} callback
|
5815
6851
|
* A function to execute when the chart object is finished loading and
|
5816
6852
|
* rendering. In most cases the chart is built in one thread, but in
|
5817
|
-
* Internet Explorer version 8 or less the chart is sometimes
|
6853
|
+
* Internet Explorer version 8 or less the chart is sometimes initialized
|
5818
6854
|
* before the document is ready, and in these cases the chart object
|
5819
6855
|
* will not be finished synchronously. As a consequence, code that
|
5820
6856
|
* relies on the newly built Chart object should always run in the
|
@@ -5985,7 +7021,7 @@
|
|
5985
7021
|
return 'right';
|
5986
7022
|
}
|
5987
7023
|
}
|
5988
|
-
return proceed.
|
7024
|
+
return proceed.apply(this, [].slice.call(arguments, 1));
|
5989
7025
|
});
|
5990
7026
|
|
5991
7027
|
// Clear axis from label panes (#6071)
|
@@ -5997,7 +7033,7 @@
|
|
5997
7033
|
delete chart._labelPanes[key];
|
5998
7034
|
}
|
5999
7035
|
|
6000
|
-
return proceed.
|
7036
|
+
return proceed.apply(this, Array.prototype.slice.call(arguments, 1));
|
6001
7037
|
});
|
6002
7038
|
|
6003
7039
|
// Override getPlotLinePath to allow for multipane charts
|