corrade-nucleus-nucleons – Blame information for rev 24
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
20 | office | 1 | /** |
2 | * @license Highcharts JS v5.0.12 (2017-05-24) |
||
3 | * |
||
4 | * (c) 2009-2017 Torstein Honsi |
||
5 | * |
||
6 | * License: www.highcharts.com/license |
||
7 | */ |
||
8 | 'use strict'; |
||
9 | (function(factory) { |
||
10 | if (typeof module === 'object' && module.exports) { |
||
11 | module.exports = factory; |
||
12 | } else { |
||
13 | factory(Highcharts); |
||
14 | } |
||
15 | }(function(Highcharts) { |
||
16 | (function(H) { |
||
17 | /** |
||
18 | * (c) 2010-2017 Torstein Honsi |
||
19 | * |
||
20 | * License: www.highcharts.com/license |
||
21 | */ |
||
22 | var Axis = H.Axis, |
||
23 | Chart = H.Chart, |
||
24 | color = H.color, |
||
25 | ColorAxis, |
||
26 | each = H.each, |
||
27 | extend = H.extend, |
||
28 | isNumber = H.isNumber, |
||
29 | Legend = H.Legend, |
||
30 | LegendSymbolMixin = H.LegendSymbolMixin, |
||
31 | noop = H.noop, |
||
32 | merge = H.merge, |
||
33 | pick = H.pick, |
||
34 | wrap = H.wrap; |
||
35 | |||
36 | /** |
||
37 | * The ColorAxis object for inclusion in gradient legends |
||
38 | */ |
||
39 | ColorAxis = H.ColorAxis = function() { |
||
40 | this.init.apply(this, arguments); |
||
41 | }; |
||
42 | extend(ColorAxis.prototype, Axis.prototype); |
||
43 | extend(ColorAxis.prototype, { |
||
44 | defaultColorAxisOptions: { |
||
45 | lineWidth: 0, |
||
46 | minPadding: 0, |
||
47 | maxPadding: 0, |
||
48 | gridLineWidth: 1, |
||
49 | tickPixelInterval: 72, |
||
50 | startOnTick: true, |
||
51 | endOnTick: true, |
||
52 | offset: 0, |
||
53 | marker: { |
||
54 | animation: { |
||
55 | duration: 50 |
||
56 | }, |
||
57 | width: 0.01, |
||
58 | |||
59 | color: '#999999' |
||
60 | |||
61 | }, |
||
62 | labels: { |
||
63 | overflow: 'justify', |
||
64 | rotation: 0 |
||
65 | }, |
||
66 | minColor: '#e6ebf5', |
||
67 | maxColor: '#003399', |
||
68 | tickLength: 5, |
||
69 | showInLegend: true |
||
70 | }, |
||
71 | |||
72 | // Properties to preserve after destroy, for Axis.update (#5881, #6025) |
||
73 | keepProps: [ |
||
74 | 'legendGroup', |
||
75 | 'legendItemHeight', |
||
76 | 'legendItemWidth', |
||
77 | 'legendItem', |
||
78 | 'legendSymbol' |
||
79 | ].concat(Axis.prototype.keepProps), |
||
80 | |||
81 | /** |
||
82 | * Initialize the color axis |
||
83 | */ |
||
84 | init: function(chart, userOptions) { |
||
85 | var horiz = chart.options.legend.layout !== 'vertical', |
||
86 | options; |
||
87 | |||
88 | this.coll = 'colorAxis'; |
||
89 | |||
90 | // Build the options |
||
91 | options = merge(this.defaultColorAxisOptions, { |
||
92 | side: horiz ? 2 : 1, |
||
93 | reversed: !horiz |
||
94 | }, userOptions, { |
||
95 | opposite: !horiz, |
||
96 | showEmpty: false, |
||
97 | title: null |
||
98 | }); |
||
99 | |||
100 | Axis.prototype.init.call(this, chart, options); |
||
101 | |||
102 | // Base init() pushes it to the xAxis array, now pop it again |
||
103 | //chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop(); |
||
104 | |||
105 | // Prepare data classes |
||
106 | if (userOptions.dataClasses) { |
||
107 | this.initDataClasses(userOptions); |
||
108 | } |
||
109 | this.initStops(); |
||
110 | |||
111 | // Override original axis properties |
||
112 | this.horiz = horiz; |
||
113 | this.zoomEnabled = false; |
||
114 | |||
115 | // Add default values |
||
116 | this.defaultLegendLength = 200; |
||
117 | }, |
||
118 | |||
119 | initDataClasses: function(userOptions) { |
||
120 | var chart = this.chart, |
||
121 | dataClasses, |
||
122 | colorCounter = 0, |
||
123 | colorCount = chart.options.chart.colorCount, |
||
124 | options = this.options, |
||
125 | len = userOptions.dataClasses.length; |
||
126 | this.dataClasses = dataClasses = []; |
||
127 | this.legendItems = []; |
||
128 | |||
129 | each(userOptions.dataClasses, function(dataClass, i) { |
||
130 | var colors; |
||
131 | |||
132 | dataClass = merge(dataClass); |
||
133 | dataClasses.push(dataClass); |
||
134 | if (!dataClass.color) { |
||
135 | if (options.dataClassColor === 'category') { |
||
136 | |||
137 | colors = chart.options.colors; |
||
138 | colorCount = colors.length; |
||
139 | dataClass.color = colors[colorCounter]; |
||
140 | |||
141 | dataClass.colorIndex = colorCounter; |
||
142 | |||
143 | // increase and loop back to zero |
||
144 | colorCounter++; |
||
145 | if (colorCounter === colorCount) { |
||
146 | colorCounter = 0; |
||
147 | } |
||
148 | } else { |
||
149 | dataClass.color = color(options.minColor).tweenTo( |
||
150 | color(options.maxColor), |
||
151 | len < 2 ? 0.5 : i / (len - 1) // #3219 |
||
152 | ); |
||
153 | } |
||
154 | } |
||
155 | }); |
||
156 | }, |
||
157 | |||
158 | initStops: function() { |
||
159 | this.stops = this.options.stops || [ |
||
160 | [0, this.options.minColor], |
||
161 | [1, this.options.maxColor] |
||
162 | ]; |
||
163 | each(this.stops, function(stop) { |
||
164 | stop.color = color(stop[1]); |
||
165 | }); |
||
166 | }, |
||
167 | |||
168 | /** |
||
169 | * Extend the setOptions method to process extreme colors and color |
||
170 | * stops. |
||
171 | */ |
||
172 | setOptions: function(userOptions) { |
||
173 | Axis.prototype.setOptions.call(this, userOptions); |
||
174 | |||
175 | this.options.crosshair = this.options.marker; |
||
176 | }, |
||
177 | |||
178 | setAxisSize: function() { |
||
179 | var symbol = this.legendSymbol, |
||
180 | chart = this.chart, |
||
181 | legendOptions = chart.options.legend || {}, |
||
182 | x, |
||
183 | y, |
||
184 | width, |
||
185 | height; |
||
186 | |||
187 | if (symbol) { |
||
188 | this.left = x = symbol.attr('x'); |
||
189 | this.top = y = symbol.attr('y'); |
||
190 | this.width = width = symbol.attr('width'); |
||
191 | this.height = height = symbol.attr('height'); |
||
192 | this.right = chart.chartWidth - x - width; |
||
193 | this.bottom = chart.chartHeight - y - height; |
||
194 | |||
195 | this.len = this.horiz ? width : height; |
||
196 | this.pos = this.horiz ? x : y; |
||
197 | } else { |
||
198 | // Fake length for disabled legend to avoid tick issues and such (#5205) |
||
199 | this.len = (this.horiz ? legendOptions.symbolWidth : legendOptions.symbolHeight) || this.defaultLegendLength; |
||
200 | } |
||
201 | }, |
||
202 | |||
203 | normalizedValue: function(value) { |
||
204 | if (this.isLog) { |
||
205 | value = this.val2lin(value); |
||
206 | } |
||
207 | return 1 - ((this.max - value) / ((this.max - this.min) || 1)); |
||
208 | }, |
||
209 | |||
210 | /** |
||
211 | * Translate from a value to a color |
||
212 | */ |
||
213 | toColor: function(value, point) { |
||
214 | var pos, |
||
215 | stops = this.stops, |
||
216 | from, |
||
217 | to, |
||
218 | color, |
||
219 | dataClasses = this.dataClasses, |
||
220 | dataClass, |
||
221 | i; |
||
222 | |||
223 | if (dataClasses) { |
||
224 | i = dataClasses.length; |
||
225 | while (i--) { |
||
226 | dataClass = dataClasses[i]; |
||
227 | from = dataClass.from; |
||
228 | to = dataClass.to; |
||
229 | if ((from === undefined || value >= from) && (to === undefined || value <= to)) { |
||
230 | color = dataClass.color; |
||
231 | if (point) { |
||
232 | point.dataClass = i; |
||
233 | point.colorIndex = dataClass.colorIndex; |
||
234 | } |
||
235 | break; |
||
236 | } |
||
237 | } |
||
238 | |||
239 | } else { |
||
240 | |||
241 | pos = this.normalizedValue(value); |
||
242 | i = stops.length; |
||
243 | while (i--) { |
||
244 | if (pos > stops[i][0]) { |
||
245 | break; |
||
246 | } |
||
247 | } |
||
248 | from = stops[i] || stops[i + 1]; |
||
249 | to = stops[i + 1] || from; |
||
250 | |||
251 | // The position within the gradient |
||
252 | pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1); |
||
253 | |||
254 | color = from.color.tweenTo( |
||
255 | to.color, |
||
256 | pos |
||
257 | ); |
||
258 | } |
||
259 | return color; |
||
260 | }, |
||
261 | |||
262 | /** |
||
263 | * Override the getOffset method to add the whole axis groups inside the legend. |
||
264 | */ |
||
265 | getOffset: function() { |
||
266 | var group = this.legendGroup, |
||
267 | sideOffset = this.chart.axisOffset[this.side]; |
||
268 | |||
269 | if (group) { |
||
270 | |||
271 | // Hook for the getOffset method to add groups to this parent group |
||
272 | this.axisParent = group; |
||
273 | |||
274 | // Call the base |
||
275 | Axis.prototype.getOffset.call(this); |
||
276 | |||
277 | // First time only |
||
278 | if (!this.added) { |
||
279 | |||
280 | this.added = true; |
||
281 | |||
282 | this.labelLeft = 0; |
||
283 | this.labelRight = this.width; |
||
284 | } |
||
285 | // Reset it to avoid color axis reserving space |
||
286 | this.chart.axisOffset[this.side] = sideOffset; |
||
287 | } |
||
288 | }, |
||
289 | |||
290 | /** |
||
291 | * Create the color gradient |
||
292 | */ |
||
293 | setLegendColor: function() { |
||
294 | var grad, |
||
295 | horiz = this.horiz, |
||
296 | reversed = this.reversed, |
||
297 | one = reversed ? 1 : 0, |
||
298 | zero = reversed ? 0 : 1; |
||
299 | |||
300 | grad = horiz ? [one, 0, zero, 0] : [0, zero, 0, one]; // #3190 |
||
301 | this.legendColor = { |
||
302 | linearGradient: { |
||
303 | x1: grad[0], |
||
304 | y1: grad[1], |
||
305 | x2: grad[2], |
||
306 | y2: grad[3] |
||
307 | }, |
||
308 | stops: this.stops |
||
309 | }; |
||
310 | }, |
||
311 | |||
312 | /** |
||
313 | * The color axis appears inside the legend and has its own legend symbol |
||
314 | */ |
||
315 | drawLegendSymbol: function(legend, item) { |
||
316 | var padding = legend.padding, |
||
317 | legendOptions = legend.options, |
||
318 | horiz = this.horiz, |
||
319 | width = pick(legendOptions.symbolWidth, horiz ? this.defaultLegendLength : 12), |
||
320 | height = pick(legendOptions.symbolHeight, horiz ? 12 : this.defaultLegendLength), |
||
321 | labelPadding = pick(legendOptions.labelPadding, horiz ? 16 : 30), |
||
322 | itemDistance = pick(legendOptions.itemDistance, 10); |
||
323 | |||
324 | this.setLegendColor(); |
||
325 | |||
326 | // Create the gradient |
||
327 | item.legendSymbol = this.chart.renderer.rect( |
||
328 | 0, |
||
329 | legend.baseline - 11, |
||
330 | width, |
||
331 | height |
||
332 | ).attr({ |
||
333 | zIndex: 1 |
||
334 | }).add(item.legendGroup); |
||
335 | |||
336 | // Set how much space this legend item takes up |
||
337 | this.legendItemWidth = width + padding + (horiz ? itemDistance : labelPadding); |
||
338 | this.legendItemHeight = height + padding + (horiz ? labelPadding : 0); |
||
339 | }, |
||
340 | /** |
||
341 | * Fool the legend |
||
342 | */ |
||
343 | setState: noop, |
||
344 | visible: true, |
||
345 | setVisible: noop, |
||
346 | getSeriesExtremes: function() { |
||
347 | var series = this.series, |
||
348 | i = series.length; |
||
349 | this.dataMin = Infinity; |
||
350 | this.dataMax = -Infinity; |
||
351 | while (i--) { |
||
352 | if (series[i].valueMin !== undefined) { |
||
353 | this.dataMin = Math.min(this.dataMin, series[i].valueMin); |
||
354 | this.dataMax = Math.max(this.dataMax, series[i].valueMax); |
||
355 | } |
||
356 | } |
||
357 | }, |
||
358 | drawCrosshair: function(e, point) { |
||
359 | var plotX = point && point.plotX, |
||
360 | plotY = point && point.plotY, |
||
361 | crossPos, |
||
362 | axisPos = this.pos, |
||
363 | axisLen = this.len; |
||
364 | |||
365 | if (point) { |
||
366 | crossPos = this.toPixels(point[point.series.colorKey]); |
||
367 | if (crossPos < axisPos) {> |
||
368 | < axisPos) { crossPos = axisPos - 2;> |
||
369 | < axisPos) { } else if (crossPos > axisPos + axisLen) {> |
||
370 | < axisPos) { crossPos = axisPos + axisLen + 2;> |
||
371 | < axisPos) { }> |
||
372 | |||
373 | < axisPos) { point.plotX = crossPos;> |
||
374 | < axisPos) { point.plotY = this.len - crossPos;> |
||
375 | < axisPos) { Axis.prototype.drawCrosshair.call(this, e, point);> |
||
376 | < axisPos) { point.plotX = plotX;> |
||
377 | < axisPos) { point.plotY = plotY;> |
||
378 | |||
379 | < axisPos) { if (this.cross) {> |
||
380 | < axisPos) { this.cross> |
||
381 | < axisPos) { .addClass('highcharts-coloraxis-marker')> |
||
382 | < axisPos) { .add(this.legendGroup);> |
||
383 | |||
384 | |||
385 | < axisPos) { this.cross.attr({> |
||
386 | < axisPos) { fill: this.crosshair.color> |
||
387 | < axisPos) { });> |
||
388 | |||
389 | |||
390 | < axisPos) { }> |
||
391 | < axisPos) { }> |
||
392 | < axisPos) { },> |
||
393 | < axisPos) { getPlotLinePath: function(a, b, c, d, pos) {> |
||
394 | < axisPos) { return isNumber(pos) ? // crosshairs only // #3969 pos can be 0 !!> |
||
395 | < axisPos) { (this.horiz ? ['M', pos - 4, this.top - 6, 'L', pos + 4, this.top - 6, pos, this.top, 'Z'] : ['M', this.left, pos, 'L', this.left - 6, pos + 6, this.left - 6, pos - 6, 'Z']) :> |
||
396 | < axisPos) { Axis.prototype.getPlotLinePath.call(this, a, b, c, d);> |
||
397 | < axisPos) { },> |
||
398 | |||
399 | < axisPos) { update: function(newOptions, redraw) {> |
||
400 | < axisPos) { var chart = this.chart,> |
||
401 | < axisPos) { legend = chart.legend;> |
||
402 | |||
403 | < axisPos) { each(this.series, function(series) {> |
||
404 | < axisPos) { series.isDirtyData = true; // Needed for Axis.update when choropleth colors change> |
||
405 | < axisPos) { });> |
||
406 | |||
407 | < axisPos) { // When updating data classes, destroy old items and make sure new ones are created (#3207)> |
||
408 | < axisPos) { if (newOptions.dataClasses && legend.allItems) {> |
||
409 | < axisPos) { each(legend.allItems, function(item) {> |
||
410 | < axisPos) { if (item.isDataClass && item.legendGroup) {> |
||
411 | < axisPos) { item.legendGroup.destroy();> |
||
412 | < axisPos) { }> |
||
413 | < axisPos) { });> |
||
414 | < axisPos) { chart.isDirtyLegend = true;> |
||
415 | < axisPos) { }> |
||
416 | |||
417 | < axisPos) { // Keep the options structure updated for export. Unlike xAxis and yAxis, the colorAxis is> |
||
418 | < axisPos) { // not an array. (#3207)> |
||
419 | < axisPos) { chart.options[this.coll] = merge(this.userOptions, newOptions);> |
||
420 | |||
421 | < axisPos) { Axis.prototype.update.call(this, newOptions, redraw);> |
||
422 | < axisPos) { if (this.legendItem) {> |
||
423 | < axisPos) { this.setLegendColor();> |
||
424 | < axisPos) { legend.colorizeItem(this, true);> |
||
425 | < axisPos) { }> |
||
426 | < axisPos) { },> |
||
427 | |||
428 | < axisPos) { /**> |
||
429 | < axisPos) { * Extend basic axis remove by also removing the legend item.> |
||
430 | < axisPos) { */> |
||
431 | < axisPos) { remove: function() {> |
||
432 | < axisPos) { if (this.legendItem) {> |
||
433 | < axisPos) { this.chart.legend.destroyItem(this);> |
||
434 | < axisPos) { }> |
||
435 | < axisPos) { Axis.prototype.remove.call(this);> |
||
436 | < axisPos) { },> |
||
437 | |||
438 | < axisPos) { /**> |
||
439 | < axisPos) { * Get the legend item symbols for data classes> |
||
440 | < axisPos) { */> |
||
441 | < axisPos) { getDataClassLegendSymbols: function() {> |
||
442 | < axisPos) { var axis = this,> |
||
443 | < axisPos) { chart = this.chart,> |
||
444 | < axisPos) { legendItems = this.legendItems,> |
||
445 | < axisPos) { legendOptions = chart.options.legend,> |
||
446 | < axisPos) { valueDecimals = legendOptions.valueDecimals,> |
||
447 | < axisPos) { valueSuffix = legendOptions.valueSuffix || '',> |
||
448 | < axisPos) { name;> |
||
449 | |||
450 | < axisPos) { if (!legendItems.length) {> |
||
451 | < axisPos) { each(this.dataClasses, function(dataClass, i) {> |
||
452 | < axisPos) { var vis = true,> |
||
453 | < axisPos) { from = dataClass.from,> |
||
454 | < axisPos) { to = dataClass.to;> |
||
455 | |||
456 | < axisPos) { // Assemble the default name. This can be overridden by legend.options.labelFormatter> |
||
457 | < axisPos) { name = '';> |
||
458 | < axisPos) { if (from === undefined) {> |
||
459 | < axisPos) { name = '< ';>> |
||
460 | < axisPos) {< '; } else if (to === undefined) {>> |
||
461 | < axisPos) {< '; name = '> ';>> |
||
462 | < axisPos) {< '; }>> |
||
463 | < axisPos) {< '; if (from !== undefined) {>> |
||
464 | < axisPos) {< '; name += H.numberFormat(from, valueDecimals) + valueSuffix;>> |
||
465 | < axisPos) {< '; }>> |
||
466 | < axisPos) {< '; if (from !== undefined && to !== undefined) {>> |
||
467 | < axisPos) {< '; name += ' - ';>> |
||
468 | < axisPos) {< '; }>> |
||
469 | < axisPos) {< '; if (to !== undefined) {>> |
||
470 | < axisPos) {< '; name += H.numberFormat(to, valueDecimals) + valueSuffix;>> |
||
471 | < axisPos) {< '; }>> |
||
472 | < axisPos) {< '; // Add a mock object to the legend items>> |
||
473 | < axisPos) {< '; legendItems.push(extend({>> |
||
474 | < axisPos) {< '; chart: chart,>> |
||
475 | < axisPos) {< '; name: name,>> |
||
476 | < axisPos) {< '; options: {},>> |
||
477 | < axisPos) {< '; drawLegendSymbol: LegendSymbolMixin.drawRectangle,>> |
||
478 | < axisPos) {< '; visible: true,>> |
||
479 | < axisPos) {< '; setState: noop,>> |
||
480 | < axisPos) {< '; isDataClass: true,>> |
||
481 | < axisPos) {< '; setVisible: function() {>> |
||
482 | < axisPos) {< '; vis = this.visible = !vis;>> |
||
483 | < axisPos) {< '; each(axis.series, function(series) {>> |
||
484 | < axisPos) {< '; each(series.points, function(point) {>> |
||
485 | < axisPos) {< '; if (point.dataClass === i) {>> |
||
486 | < axisPos) {< '; point.setVisible(vis);>> |
||
487 | < axisPos) {< '; }>> |
||
488 | < axisPos) {< '; });>> |
||
489 | < axisPos) {< '; });>> |
||
490 | |||
491 | < axisPos) {< '; chart.legend.colorizeItem(this, vis);>> |
||
492 | < axisPos) {< '; }>> |
||
493 | < axisPos) {< '; }, dataClass));>> |
||
494 | < axisPos) {< '; });>> |
||
495 | < axisPos) {< '; }>> |
||
496 | < axisPos) {< '; return legendItems;>> |
||
497 | < axisPos) {< '; },>> |
||
498 | < axisPos) {< '; name: '' // Prevents 'undefined' in legend in IE8>> |
||
499 | < axisPos) {< '; });>> |
||
500 | |||
501 | < axisPos) {< '; /**>> |
||
502 | < axisPos) {< '; * Handle animation of the color attributes directly>> |
||
503 | < axisPos) {< '; */>> |
||
504 | < axisPos) {< '; each(['fill', 'stroke'], function(prop) {>> |
||
505 | < axisPos) {< '; H.Fx.prototype[prop + 'Setter'] = function() {>> |
||
506 | < axisPos) {< '; this.elem.attr(>> |
||
507 | < axisPos) {< '; prop,>> |
||
508 | < axisPos) {< '; color(this.start).tweenTo(>> |
||
509 | < axisPos) {< '; color(this.end),>> |
||
510 | < axisPos) {< '; this.pos>> |
||
511 | < axisPos) {< '; ),>> |
||
512 | < axisPos) {< '; null,>> |
||
513 | < axisPos) {< '; true>> |
||
514 | < axisPos) {< '; );>> |
||
515 | < axisPos) {< '; };>> |
||
516 | < axisPos) {< '; });>> |
||
517 | |||
518 | < axisPos) {< '; /**>> |
||
519 | < axisPos) {< '; * Extend the chart getAxes method to also get the color axis>> |
||
520 | < axisPos) {< '; */>> |
||
521 | < axisPos) {< '; wrap(Chart.prototype, 'getAxes', function(proceed) {>> |
||
522 | |||
523 | < axisPos) {< '; var options = this.options,>> |
||
524 | < axisPos) {< '; colorAxisOptions = options.colorAxis;>> |
||
525 | |||
526 | < axisPos) {< '; proceed.call(this);>> |
||
527 | |||
528 | < axisPos) {< '; this.colorAxis = [];>> |
||
529 | < axisPos) {< '; if (colorAxisOptions) {>> |
||
530 | < axisPos) {< '; new ColorAxis(this, colorAxisOptions); // eslint-disable-line no-new>> |
||
531 | < axisPos) {< '; }>> |
||
532 | < axisPos) {< '; });>> |
||
533 | |||
534 | |||
535 | < axisPos) {< '; /**>> |
||
536 | < axisPos) {< '; * Wrap the legend getAllItems method to add the color axis. This also removes the>> |
||
537 | < axisPos) {< '; * axis' own series to prevent them from showing up individually.>> |
||
538 | < axisPos) {< '; */>> |
||
539 | < axisPos) {< '; wrap(Legend.prototype, 'getAllItems', function(proceed) {>> |
||
540 | < axisPos) {< '; var allItems = [],>> |
||
541 | < axisPos) {< '; colorAxis = this.chart.colorAxis[0];>> |
||
542 | |||
543 | < axisPos) {< '; if (colorAxis && colorAxis.options) {>> |
||
544 | < axisPos) {< '; if (colorAxis.options.showInLegend) {>> |
||
545 | < axisPos) {< '; // Data classes>> |
||
546 | < axisPos) {< '; if (colorAxis.options.dataClasses) {>> |
||
547 | < axisPos) {< '; allItems = allItems.concat(colorAxis.getDataClassLegendSymbols());>> |
||
548 | < axisPos) {< '; // Gradient legend>> |
||
549 | < axisPos) {< '; } else {>> |
||
550 | < axisPos) {< '; // Add this axis on top>> |
||
551 | < axisPos) {< '; allItems.push(colorAxis);>> |
||
552 | < axisPos) {< '; }>> |
||
553 | < axisPos) {< '; }>> |
||
554 | |||
555 | < axisPos) {< '; // Don't add the color axis' series>> |
||
556 | < axisPos) {< '; each(colorAxis.series, function(series) {>> |
||
557 | < axisPos) {< '; series.options.showInLegend = false;>> |
||
558 | < axisPos) {< '; });>> |
||
559 | < axisPos) {< '; }>> |
||
560 | |||
561 | < axisPos) {< '; return allItems.concat(proceed.call(this));>> |
||
562 | < axisPos) {< '; });>> |
||
563 | |||
564 | < axisPos) {< '; wrap(Legend.prototype, 'colorizeItem', function(proceed, item, visible) {>> |
||
565 | < axisPos) {< '; proceed.call(this, item, visible);>> |
||
566 | < axisPos) {< '; if (visible && item.legendColor) {>> |
||
567 | < axisPos) {< '; item.legendSymbol.attr({>> |
||
568 | < axisPos) {< '; fill: item.legendColor>> |
||
569 | < axisPos) {< '; });>> |
||
570 | < axisPos) {< '; }>> |
||
571 | < axisPos) {< '; });>> |
||
572 | |||
573 | < axisPos) {< '; }(Highcharts));>> |
||
574 | < axisPos) {< '; (function(H) {>> |
||
575 | < axisPos) {< '; /**>> |
||
576 | < axisPos) {< '; * (c) 2010-2017 Torstein Honsi>> |
||
577 | < axisPos) {< '; *>> |
||
578 | < axisPos) {< '; * License: www.highcharts.com/license>> |
||
579 | < axisPos) {< '; */>> |
||
580 | < axisPos) {< '; var defined = H.defined,>> |
||
581 | < axisPos) {< '; each = H.each,>> |
||
582 | < axisPos) {< '; noop = H.noop,>> |
||
583 | < axisPos) {< '; seriesTypes = H.seriesTypes;>> |
||
584 | |||
585 | < axisPos) {< '; /**>> |
||
586 | < axisPos) {< '; * Mixin for maps and heatmaps>> |
||
587 | < axisPos) {< '; */>> |
||
588 | < axisPos) {< '; H.colorPointMixin = {>> |
||
589 | < axisPos) {< '; /**>> |
||
590 | < axisPos) {< '; * Color points have a value option that determines whether or not it is a null point>> |
||
591 | < axisPos) {< '; */>> |
||
592 | < axisPos) {< '; isValid: function() {>> |
||
593 | < axisPos) {< '; return this.value !== null;>> |
||
594 | < axisPos) {< '; },>> |
||
595 | |||
596 | < axisPos) {< '; /**>> |
||
597 | < axisPos) {< '; * Set the visibility of a single point>> |
||
598 | < axisPos) {< '; */>> |
||
599 | < axisPos) {< '; setVisible: function(vis) {>> |
||
600 | < axisPos) {< '; var point = this,>> |
||
601 | < axisPos) {< '; method = vis ? 'show' : 'hide';>> |
||
602 | |||
603 | < axisPos) {< '; // Show and hide associated elements>> |
||
604 | < axisPos) {< '; each(['graphic', 'dataLabel'], function(key) {>> |
||
605 | < axisPos) {< '; if (point[key]) {>> |
||
606 | < axisPos) {< '; point[key][method]();>> |
||
607 | < axisPos) {< '; }>> |
||
608 | < axisPos) {< '; });>> |
||
609 | < axisPos) {< '; },>> |
||
610 | < axisPos) {< '; setState: function(state) {>> |
||
611 | < axisPos) {< '; H.Point.prototype.setState.call(this, state);>> |
||
612 | < axisPos) {< '; if (this.graphic) {>> |
||
613 | < axisPos) {< '; this.graphic.attr({>> |
||
614 | < axisPos) {< '; zIndex: state === 'hover' ? 1 : 0>> |
||
615 | < axisPos) {< '; });>> |
||
616 | < axisPos) {< '; }>> |
||
617 | < axisPos) {< '; }>> |
||
618 | < axisPos) {< '; };>> |
||
619 | |||
620 | < axisPos) {< '; H.colorSeriesMixin = {>> |
||
621 | < axisPos) {< '; pointArrayMap: ['value'],>> |
||
622 | < axisPos) {< '; axisTypes: ['xAxis', 'yAxis', 'colorAxis'],>> |
||
623 | < axisPos) {< '; optionalAxis: 'colorAxis',>> |
||
624 | < axisPos) {< '; trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],>> |
||
625 | < axisPos) {< '; getSymbol: noop,>> |
||
626 | < axisPos) {< '; parallelArrays: ['x', 'y', 'value'],>> |
||
627 | < axisPos) {< '; colorKey: 'value',>> |
||
628 | |||
629 | |||
630 | < axisPos) {< '; pointAttribs: seriesTypes.column.prototype.pointAttribs,>> |
||
631 | |||
632 | |||
633 | < axisPos) {< '; /**>> |
||
634 | < axisPos) {< '; * In choropleth maps, the color is a result of the value, so this needs translation too>> |
||
635 | < axisPos) {< '; */>> |
||
636 | < axisPos) {< '; translateColors: function() {>> |
||
637 | < axisPos) {< '; var series = this,>> |
||
638 | < axisPos) {< '; nullColor = this.options.nullColor,>> |
||
639 | < axisPos) {< '; colorAxis = this.colorAxis,>> |
||
640 | < axisPos) {< '; colorKey = this.colorKey;>> |
||
641 | |||
642 | < axisPos) {< '; each(this.data, function(point) {>> |
||
643 | < axisPos) {< '; var value = point[colorKey],>> |
||
644 | < axisPos) {< '; color;>> |
||
645 | |||
646 | < axisPos) {< '; color = point.options.color ||>> |
||
647 | < axisPos) {< '; (point.isNull ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color);>> |
||
648 | |||
649 | < axisPos) {< '; if (color) {>> |
||
650 | < axisPos) {< '; point.color = color;>> |
||
651 | < axisPos) {< '; }>> |
||
652 | < axisPos) {< '; });>> |
||
653 | < axisPos) {< '; },>> |
||
654 | |||
655 | < axisPos) {< '; /**>> |
||
656 | < axisPos) {< '; * Get the color attibutes to apply on the graphic>> |
||
657 | < axisPos) {< '; */>> |
||
658 | < axisPos) {< '; colorAttribs: function(point) {>> |
||
659 | < axisPos) {< '; var ret = {};>> |
||
660 | < axisPos) {< '; if (defined(point.color)) {>> |
||
661 | < axisPos) {< '; ret[this.colorProp || 'fill'] = point.color;>> |
||
662 | < axisPos) {< '; }>> |
||
663 | < axisPos) {< '; return ret;>> |
||
664 | < axisPos) {< '; }>> |
||
665 | < axisPos) {< '; };>> |
||
666 | |||
667 | < axisPos) {< '; }(Highcharts));>> |
||
668 | < axisPos) {< '; (function(H) {>> |
||
669 | < axisPos) {< '; /**>> |
||
670 | < axisPos) {< '; * (c) 2010-2017 Torstein Honsi>> |
||
671 | < axisPos) {< '; *>> |
||
672 | < axisPos) {< '; * License: www.highcharts.com/license>> |
||
673 | < axisPos) {< '; */>> |
||
674 | < axisPos) {< '; var colorPointMixin = H.colorPointMixin,>> |
||
675 | < axisPos) {< '; colorSeriesMixin = H.colorSeriesMixin,>> |
||
676 | < axisPos) {< '; each = H.each,>> |
||
677 | < axisPos) {< '; LegendSymbolMixin = H.LegendSymbolMixin,>> |
||
678 | < axisPos) {< '; merge = H.merge,>> |
||
679 | < axisPos) {< '; noop = H.noop,>> |
||
680 | < axisPos) {< '; pick = H.pick,>> |
||
681 | < axisPos) {< '; Series = H.Series,>> |
||
682 | < axisPos) {< '; seriesType = H.seriesType,>> |
||
683 | < axisPos) {< '; seriesTypes = H.seriesTypes;>> |
||
684 | |||
685 | < axisPos) {< '; // The Heatmap series type>> |
||
686 | < axisPos) {< '; seriesType('heatmap', 'scatter', {>> |
||
687 | < axisPos) {< '; animation: false,>> |
||
688 | < axisPos) {< '; borderWidth: 0,>> |
||
689 | |||
690 | < axisPos) {< '; nullColor: '#f7f7f7',>> |
||
691 | |||
692 | < axisPos) {< '; dataLabels: {>> |
||
693 | < axisPos) {< '; formatter: function() { // #2945>> |
||
694 | < axisPos) {< '; return this.point.value;>> |
||
695 | < axisPos) {< '; },>> |
||
696 | < axisPos) {< '; inside: true,>> |
||
697 | < axisPos) {< '; verticalAlign: 'middle',>> |
||
698 | < axisPos) {< '; crop: false,>> |
||
699 | < axisPos) {< '; overflow: false,>> |
||
700 | < axisPos) {< '; padding: 0 // #3837>> |
||
701 | < axisPos) {< '; },>> |
||
702 | < axisPos) {< '; marker: null,>> |
||
703 | < axisPos) {< '; pointRange: null, // dynamically set to colsize by default>> |
||
704 | < axisPos) {< '; tooltip: {>> |
||
705 | < axisPos) {< '; pointFormat: '{point.x}, {point.y}: {point.value}<br/>'>> |
||
706 | < axisPos) {< '; },>> |
||
707 | < axisPos) {< '; states: {>> |
||
708 | < axisPos) {< '; normal: {>> |
||
709 | < axisPos) {< '; animation: true>> |
||
710 | < axisPos) {< '; },>> |
||
711 | < axisPos) {< '; hover: {>> |
||
712 | < axisPos) {< '; halo: false, // #3406, halo is not required on heatmaps>> |
||
713 | < axisPos) {< '; brightness: 0.2>> |
||
714 | < axisPos) {< '; }>> |
||
715 | < axisPos) {< '; }>> |
||
716 | < axisPos) {< '; }, merge(colorSeriesMixin, {>> |
||
717 | < axisPos) {< '; pointArrayMap: ['y', 'value'],>> |
||
718 | < axisPos) {< '; hasPointSpecificOptions: true,>> |
||
719 | < axisPos) {< '; supportsDrilldown: true,>> |
||
720 | < axisPos) {< '; getExtremesFromAll: true,>> |
||
721 | < axisPos) {< '; directTouch: true,>> |
||
722 | |||
723 | < axisPos) {< '; /**>> |
||
724 | < axisPos) {< '; * Override the init method to add point ranges on both axes.>> |
||
725 | < axisPos) {< '; */>> |
||
726 | < axisPos) {< '; init: function() {>> |
||
727 | < axisPos) {< '; var options;>> |
||
728 | < axisPos) {< '; seriesTypes.scatter.prototype.init.apply(this, arguments);>> |
||
729 | |||
730 | < axisPos) {< '; options = this.options;>> |
||
731 | < axisPos) {< '; options.pointRange = pick(options.pointRange, options.colsize || 1); // #3758, prevent resetting in setData>> |
||
732 | < axisPos) {< '; this.yAxis.axisPointRange = options.rowsize || 1; // general point range>> |
||
733 | < axisPos) {< '; },>> |
||
734 | < axisPos) {< '; translate: function() {>> |
||
735 | < axisPos) {< '; var series = this,>> |
||
736 | < axisPos) {< '; options = series.options,>> |
||
737 | < axisPos) {< '; xAxis = series.xAxis,>> |
||
738 | < axisPos) {< '; yAxis = series.yAxis,>> |
||
739 | < axisPos) {< '; between = function(x, a, b) {>> |
||
740 | < axisPos) {< '; return Math.min(Math.max(a, x), b);>> |
||
741 | < axisPos) {< '; };>> |
||
742 | |||
743 | < axisPos) {< '; series.generatePoints();>> |
||
744 | |||
745 | < axisPos) {< '; each(series.points, function(point) {>> |
||
746 | < axisPos) {< '; var xPad = (options.colsize || 1) / 2,>> |
||
747 | < axisPos) {< '; yPad = (options.rowsize || 1) / 2,>> |
||
748 | < axisPos) {< '; x1 = between(Math.round(xAxis.len - xAxis.translate(point.x - xPad, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len),>> |
||
749 | < axisPos) {< '; x2 = between(Math.round(xAxis.len - xAxis.translate(point.x + xPad, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len),>> |
||
750 | < axisPos) {< '; y1 = between(Math.round(yAxis.translate(point.y - yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len),>> |
||
751 | < axisPos) {< '; y2 = between(Math.round(yAxis.translate(point.y + yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len);>> |
||
752 | |||
753 | < axisPos) {< '; // Set plotX and plotY for use in K-D-Tree and more>> |
||
754 | < axisPos) {< '; point.plotX = point.clientX = (x1 + x2) / 2;>> |
||
755 | < axisPos) {< '; point.plotY = (y1 + y2) / 2;>> |
||
756 | |||
757 | < axisPos) {< '; point.shapeType = 'rect';>> |
||
758 | < axisPos) {< '; point.shapeArgs = {>> |
||
759 | < axisPos) {< '; x: Math.min(x1, x2),>> |
||
760 | < axisPos) {< '; y: Math.min(y1, y2),>> |
||
761 | < axisPos) {< '; width: Math.abs(x2 - x1),>> |
||
762 | < axisPos) {< '; height: Math.abs(y2 - y1)>> |
||
763 | < axisPos) {< '; };>> |
||
764 | < axisPos) {< '; });>> |
||
765 | |||
766 | < axisPos) {< '; series.translateColors();>> |
||
767 | < axisPos) {< '; },>> |
||
768 | < axisPos) {< '; drawPoints: function() {>> |
||
769 | < axisPos) {< '; seriesTypes.column.prototype.drawPoints.call(this);>> |
||
770 | |||
771 | < axisPos) {< '; each(this.points, function(point) {>> |
||
772 | |||
773 | < axisPos) {< '; point.graphic.attr(this.colorAttribs(point));>> |
||
774 | |||
775 | < axisPos) {< '; }, this);>> |
||
776 | < axisPos) {< '; },>> |
||
777 | < axisPos) {< '; animate: noop,>> |
||
778 | < axisPos) {< '; getBox: noop,>> |
||
779 | < axisPos) {< '; drawLegendSymbol: LegendSymbolMixin.drawRectangle,>> |
||
780 | < axisPos) {< '; alignDataLabel: seriesTypes.column.prototype.alignDataLabel,>> |
||
781 | < axisPos) {< '; getExtremes: function() {>> |
||
782 | < axisPos) {< '; // Get the extremes from the value data>> |
||
783 | < axisPos) {< '; Series.prototype.getExtremes.call(this, this.valueData);>> |
||
784 | < axisPos) {< '; this.valueMin = this.dataMin;>> |
||
785 | < axisPos) {< '; this.valueMax = this.dataMax;>> |
||
786 | |||
787 | < axisPos) {< '; // Get the extremes from the y data>> |
||
788 | < axisPos) {< '; Series.prototype.getExtremes.call(this);>> |
||
789 | < axisPos) {< '; }>> |
||
790 | |||
791 | < axisPos) {< '; }), colorPointMixin);>> |
||
792 | |||
793 | < axisPos) {< '; }(Highcharts));>> |
||
794 | < axisPos) {< ';}));>> |