|
2 | 2 | // @compilation_level SIMPLE_OPTIMIZATIONS
|
3 | 3 |
|
4 | 4 | /**
|
5 |
| - * @license Highcharts JS v4.2.2 (2016-02-04) |
| 5 | + * @license Highcharts JS v4.2.3 (2016-02-08) |
6 | 6 | *
|
7 | 7 | * (c) 2009-2016 Torstein Honsi
|
8 | 8 | *
|
|
59 | 59 | charts = [],
|
60 | 60 | chartCount = 0,
|
61 | 61 | PRODUCT = 'Highcharts',
|
62 |
| - VERSION = '4.2.2', |
| 62 | + VERSION = '4.2.3', |
63 | 63 |
|
64 | 64 | // some constants for frequently used strings
|
65 | 65 | DIV = 'div',
|
|
1533 | 1533 | useUTC: true,
|
1534 | 1534 | //timezoneOffset: 0,
|
1535 | 1535 | canvasToolsURL: 'http://code.highcharts.com/modules/canvas-tools.js',
|
1536 |
| - VMLRadialGradientURL: 'http://code.highcharts.com/4.2.2/gfx/vml-radial-gradient.png' |
| 1536 | + VMLRadialGradientURL: 'http://code.highcharts.com/4.2.3/gfx/vml-radial-gradient.png' |
1537 | 1537 | },
|
1538 | 1538 | chart: {
|
1539 | 1539 | //animation: true,
|
|
2482 | 2482 | key,
|
2483 | 2483 | attribs = {},
|
2484 | 2484 | normalizer,
|
2485 |
| - strokeWidth = rect.strokeWidth || wrapper.strokeWidth || 0; |
| 2485 | + strokeWidth = wrapper.strokeWidth || 0; |
2486 | 2486 |
|
2487 | 2487 | normalizer = mathRound(strokeWidth) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors
|
2488 | 2488 |
|
|
3957 | 3957 | };
|
3958 | 3958 |
|
3959 | 3959 | if (strokeWidth !== UNDEFINED) {
|
3960 |
| - attribs.strokeWidth = strokeWidth; |
| 3960 | + wrapper.strokeWidth = strokeWidth; |
3961 | 3961 | attribs = wrapper.crisp(attribs);
|
3962 | 3962 | }
|
3963 | 3963 |
|
3964 | 3964 | if (r) {
|
3965 | 3965 | attribs.r = r;
|
3966 | 3966 | }
|
3967 | 3967 |
|
3968 |
| - wrapper.rSetter = function (value) { |
3969 |
| - attr(this.element, { |
| 3968 | + wrapper.rSetter = function (value, key, element) { |
| 3969 | + attr(element, { |
3970 | 3970 | rx: value,
|
3971 | 3971 | ry: value
|
3972 | 3972 | });
|
|
10545 | 10545 |
|
10546 | 10546 | var chart = this.chart;
|
10547 | 10547 |
|
10548 |
| - if (!defined(hoverChartIndex) || !charts[hoverChartIndex].mouseIsDown) { |
| 10548 | + if (!defined(hoverChartIndex) || !charts[hoverChartIndex] || !charts[hoverChartIndex].mouseIsDown) { |
10549 | 10549 | hoverChartIndex = chart.index;
|
10550 | 10550 | }
|
10551 | 10551 |
|
|
12852 | 12852 | })
|
12853 | 12853 | .add();
|
12854 | 12854 | } else {
|
| 12855 | + plotBorder.strokeWidth = -plotBorderWidth; |
12855 | 12856 | plotBorder.animate(
|
12856 |
| - plotBorder.crisp({ x: plotLeft, y: plotTop, width: plotWidth, height: plotHeight, strokeWidth: -plotBorderWidth }) //#3282 plotBorder should be negative |
| 12857 | + plotBorder.crisp({ x: plotLeft, y: plotTop, width: plotWidth, height: plotHeight }) //#3282 plotBorder should be negative |
12857 | 12858 | );
|
12858 | 12859 | }
|
12859 | 12860 | }
|
|
13364 | 13365 |
|
13365 | 13366 | // If no x is set by now, get auto incremented value. All points must have an
|
13366 | 13367 | // x value, however the y value can be null to create a gap in the series
|
13367 |
| - if (point.x === UNDEFINED && series) { |
13368 |
| - point.x = x === UNDEFINED ? series.autoIncrement() : x; |
| 13368 | + if (typeof point.x !== 'number' && series) { |
| 13369 | + point.x = x === undefined ? series.autoIncrement() : x; |
13369 | 13370 | }
|
13370 | 13371 |
|
13371 | 13372 | return point;
|
|
14351 | 14352 | /**
|
14352 | 14353 | * Return the series points with null points filtered out
|
14353 | 14354 | */
|
14354 |
| - getValidPoints: function () { |
14355 |
| - return grep(this.points, function (point) { |
| 14355 | + getValidPoints: function (points) { |
| 14356 | + return grep(points || this.points, function (point) { |
14356 | 14357 | return !point.isNull;
|
14357 | 14358 | });
|
14358 | 14359 | },
|
@@ -14811,11 +14812,28 @@
|
14811 | 14812 | var series = this,
|
14812 | 14813 | options = series.options,
|
14813 | 14814 | step = options.step,
|
| 14815 | + reversed, |
14814 | 14816 | graphPath = [],
|
14815 | 14817 | gap;
|
14816 | 14818 |
|
14817 | 14819 | points = points || series.points;
|
14818 | 14820 |
|
| 14821 | + // Bottom of a stack is reversed |
| 14822 | + reversed = points.reversed; |
| 14823 | + if (reversed) { |
| 14824 | + points.reverse(); |
| 14825 | + } |
| 14826 | + // Reverse the steps (#5004) |
| 14827 | + step = { right: 1, center: 2 }[step] || (step && 3); |
| 14828 | + if (step && reversed) { |
| 14829 | + step = 4 - step; |
| 14830 | + } |
| 14831 | + |
| 14832 | + // Remove invalid points, especially in spline (#5015) |
| 14833 | + if (options.connectNulls && !nullsAsZeroes && !connectCliffs) { |
| 14834 | + points = this.getValidPoints(points); |
| 14835 | + } |
| 14836 | + |
14819 | 14837 | // Build the line
|
14820 | 14838 | each(points, function (point, i) {
|
14821 | 14839 |
|
@@ -14847,14 +14865,14 @@
|
14847 | 14865 |
|
14848 | 14866 | } else if (step) {
|
14849 | 14867 |
|
14850 |
| - if (step === 'right') { |
| 14868 | + if (step === 1) { // right |
14851 | 14869 | pathToPoint = [
|
14852 | 14870 | L,
|
14853 | 14871 | lastPoint.plotX,
|
14854 | 14872 | plotY
|
14855 | 14873 | ];
|
14856 | 14874 |
|
14857 |
| - } else if (step === 'center') { |
| 14875 | + } else if (step === 2) { // center |
14858 | 14876 | pathToPoint = [
|
14859 | 14877 | L,
|
14860 | 14878 | (lastPoint.plotX + plotX) / 2,
|
|
15327 | 15345 |
|
15328 | 15346 | // Start the recursive build process with a clone of the points array and null points filtered out (#3873)
|
15329 | 15347 | function startRecursive() {
|
15330 |
| - var points = grep(series.points || [], function (point) { // #4390 |
15331 |
| - return point.y !== null; |
15332 |
| - }); |
15333 |
| - |
15334 |
| - series.kdTree = _kdtree(points, dimensions, dimensions); |
| 15348 | + series.kdTree = _kdtree(series.getValidPoints(), dimensions, dimensions); |
15335 | 15349 | }
|
15336 | 15350 | delete series.kdTree;
|
15337 | 15351 |
|
|
16564 | 16578 |
|
16565 | 16579 | topPath = getGraphPath.call(this, graphPoints, true, true);
|
16566 | 16580 |
|
16567 |
| - bottomPath = getGraphPath.call(this, bottomPoints.reverse(), true, true); |
| 16581 | + bottomPoints.reversed = true; |
| 16582 | + bottomPath = getGraphPath.call(this, bottomPoints, true, true); |
16568 | 16583 | if (bottomPath.length) {
|
16569 | 16584 | bottomPath[0] = L;
|
16570 | 16585 | }
|
@@ -16660,16 +16675,18 @@
|
16660 | 16675 | lastY = lastPoint.plotY,
|
16661 | 16676 | nextX = nextPoint.plotX,
|
16662 | 16677 | nextY = nextPoint.plotY,
|
16663 |
| - correction; |
| 16678 | + correction = 0; |
16664 | 16679 |
|
16665 | 16680 | leftContX = (smoothing * plotX + lastX) / denom;
|
16666 | 16681 | leftContY = (smoothing * plotY + lastY) / denom;
|
16667 | 16682 | rightContX = (smoothing * plotX + nextX) / denom;
|
16668 | 16683 | rightContY = (smoothing * plotY + nextY) / denom;
|
16669 | 16684 |
|
16670 |
| - // have the two control points make a straight line through main point |
16671 |
| - correction = ((rightContY - leftContY) * (rightContX - plotX)) / |
16672 |
| - (rightContX - leftContX) + plotY - rightContY; |
| 16685 | + // Have the two control points make a straight line through main point |
| 16686 | + if (rightContX !== leftContX) { // #5016, division by zero |
| 16687 | + correction = ((rightContY - leftContY) * (rightContX - plotX)) / |
| 16688 | + (rightContX - leftContX) + plotY - rightContY; |
| 16689 | + } |
16673 | 16690 |
|
16674 | 16691 | leftContY += correction;
|
16675 | 16692 | rightContY += correction;
|
|
0 commit comments