Skip to content
This repository was archived by the owner on Sep 1, 2021. It is now read-only.

Commit ece37b1

Browse files
Release v4.1.4
1 parent 44a7d2a commit ece37b1

15 files changed

+158
-99
lines changed

CHANGELOG.markdown

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
# 4.1.4 / 2015-03-10
2+
3+
* Updated Highcharts to 4.1.4
4+
* Added originalEvent to wrapped event argument for point and series click. Closed #3913.
5+
* Changed description for error 23 (related to #3920).
6+
* Fixed data.parseDate callback.
7+
* Fixed #1093, chart was resized after cancelling print.
8+
* Fixed #3890, errors on box plots and error bar series when stacking was set in general plot options.
9+
* Fixed #3891, axis label rotation not working outside -90 to 90.
10+
* Fixed #3899, tooltip on column range only working on one point per X value.
11+
* Fixed #3901, tooltip displaying for null points.
12+
* Fixed #3904, shared tooltip gave errors with null points.
13+
* Fixed #3911, data label duplication on WebKit with Retina displays.
14+
* Fixed #3919, click event always triggered on the same point with a shared tooltip.
15+
* Fixed #3920, color tweening with gradient fills caused black result.
16+
* Fixed #3926, tooltip not showing when entering the plot directly on a column.
17+
* Fixed #3932, shadow was not applied when negativeColor was used.
18+
* Fixed #3934, pie chart did not update when legend was hidden.
19+
* Fixed #3937, pointer events not reset after chart destroy.
20+
* Fixed #3945, tooltip did't work afer resize.
21+
* Fixed regression causing mouseover to not work with a single series.
22+
123
# 4.1.3 / 2015-02-27
224

325
* Updated Highcharts to 4.1.3

app/assets/javascripts/highcharts.js

+68-38
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @compilation_level SIMPLE_OPTIMIZATIONS
33

44
/**
5-
* @license Highcharts JS v4.1.3 (2015-02-27)
5+
* @license Highcharts JS v4.1.4 (2015-03-10)
66
*
77
* (c) 2009-2014 Torstein Honsi
88
*
@@ -56,7 +56,7 @@ var UNDEFINED,
5656
charts = [],
5757
chartCount = 0,
5858
PRODUCT = 'Highcharts',
59-
VERSION = '4.1.3',
59+
VERSION = '4.1.4',
6060

6161
// some constants for frequently used strings
6262
DIV = 'div',
@@ -149,8 +149,8 @@ function merge() {
149149
value = original[key];
150150

151151
// Copy the contents of objects, but not arrays or DOM nodes
152-
if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]'
153-
&& key !== 'renderTo' && typeof value.nodeType !== 'number') {
152+
if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]' &&
153+
key !== 'renderTo' && typeof value.nodeType !== 'number') {
154154
copy[key] = doCopy(copy[key] || {}, value);
155155

156156
// Primitives and arrays are copied over directly
@@ -1259,8 +1259,8 @@ defaultOptions = {
12591259
global: {
12601260
useUTC: true,
12611261
//timezoneOffset: 0,
1262-
canvasToolsURL: 'http://code.highcharts.com/4.1.3/modules/canvas-tools.js',
1263-
VMLRadialGradientURL: 'http://code.highcharts.com/4.1.3/gfx/vml-radial-gradient.png'
1262+
canvasToolsURL: 'http://code.highcharts.com/4.1.4/modules/canvas-tools.js',
1263+
VMLRadialGradientURL: 'http://code.highcharts.com/4.1.4/gfx/vml-radial-gradient.png'
12641264
},
12651265
chart: {
12661266
//animation: true,
@@ -1768,7 +1768,8 @@ var Color = function (input) {
17681768
get: get,
17691769
brighten: brighten,
17701770
rgba: rgba,
1771-
setOpacity: setOpacity
1771+
setOpacity: setOpacity,
1772+
raw: input
17721773
};
17731774
};
17741775

@@ -2858,17 +2859,22 @@ SVGElement.prototype = {
28582859
otherZIndex,
28592860
element = this.element,
28602861
inserted,
2862+
run = this.added,
28612863
i;
28622864

28632865
if (defined(value)) {
28642866
element.setAttribute(key, value); // So we can read it for other elements in the group
2865-
this[key] = +value;
2867+
value = +value;
2868+
if (this[key] === value) { // Only update when needed (#3865)
2869+
run = false;
2870+
}
2871+
this[key] = value;
28662872
}
28672873

28682874
// Insert according to this and other elements' zIndex. Before .add() is called,
28692875
// nothing is done. Then on add, or by later calls to zIndexSetter, the node
28702876
// is placed on the right place in the DOM.
2871-
if (this.added) {
2877+
if (run) {
28722878
value = this.zIndex;
28732879

28742880
if (value && parentGroup) {
@@ -4152,7 +4158,11 @@ SVGRenderer.prototype = {
41524158
if (x !== text.x || y !== text.y) {
41534159
text.attr('x', x);
41544160
if (y !== UNDEFINED) {
4155-
text.attr('y', y);
4161+
// As a workaround for #3649, use translation instead of y attribute. #3649
4162+
// is a rendering bug in WebKit for Retina (Mac, iOS, PhantomJS) that
4163+
// results in duplicated text when an y attribute is used in combination
4164+
// with a CSS text-style.
4165+
text.attr(text.element.nodeName === 'SPAN' ? 'y' : 'translateY', y);
41564166
}
41574167
}
41584168

@@ -7193,17 +7203,18 @@ Axis.prototype = {
71937203
linkedParent = axis.linkedParent,
71947204
ordinalCorrection,
71957205
hasCategories = !!axis.categories,
7196-
transA = axis.transA;
7206+
transA = axis.transA,
7207+
isXAxis = axis.isXAxis;
71977208

71987209
// Adjust translation for padding. Y axis with categories need to go through the same (#1784).
7199-
if (axis.isXAxis || hasCategories || pointRange) {
7210+
if (isXAxis || hasCategories || pointRange) {
72007211
if (linkedParent) {
72017212
minPointOffset = linkedParent.minPointOffset;
72027213
pointRangePadding = linkedParent.pointRangePadding;
72037214

72047215
} else {
72057216
each(axis.series, function (series) {
7206-
var seriesPointRange = hasCategories ? 1 : (axis.isXAxis ? series.pointRange : (axis.axisPointRange || 0)), // #2806
7217+
var seriesPointRange = hasCategories ? 1 : (isXAxis ? series.pointRange : (axis.axisPointRange || 0)), // #2806
72077218
pointPlacement = series.options.pointPlacement,
72087219
seriesClosestPointRange = series.closestPointRange;
72097220

@@ -7249,7 +7260,9 @@ Axis.prototype = {
72497260
// closestPointRange means the closest distance between points. In columns
72507261
// it is mostly equal to pointRange, but in lines pointRange is 0 while closestPointRange
72517262
// is some other value
7252-
axis.closestPointRange = closestPointRange;
7263+
if (isXAxis) {
7264+
axis.closestPointRange = closestPointRange;
7265+
}
72537266
}
72547267

72557268
// Secondary values
@@ -7886,7 +7899,7 @@ Axis.prototype = {
78867899
each(autoRotation, function (rot) {
78877900
var score;
78887901

7889-
if (rot && rot >= -90 && rot <= 90) {
7902+
if (rot === rotationOption || (rot && rot >= -90 && rot <= 90)) { // #3891
78907903

78917904
step = getStep(mathAbs(labelMetrics.h / mathSin(deg2rad * rot)));
78927905

@@ -9528,6 +9541,7 @@ Pointer.prototype = {
95289541
}
95299542
}
95309543

9544+
// Handle shared tooltip or cases where a series is not yet hovered
95319545
if (!(hoverSeries && hoverSeries.noSharedTooltip) && (shared || !hoverSeries)) { // #3821
95329546
// Find nearest points on all series
95339547
each(series, function (s) {
@@ -9549,35 +9563,43 @@ Pointer.prototype = {
95499563
kdpoint = p;
95509564
}
95519565
}
9552-
//point = kdpoints[0];
95539566
});
9567+
9568+
// Handle non-shared tooltips
95549569
} else {
9555-
kdpoint = hoverSeries ? hoverSeries.searchPoint(e) : UNDEFINED;
9570+
// If it has a hoverPoint and that series requires direct touch (like columns), use the hoverPoint (#3899).
9571+
// Otherwise, search the k-d tree (like scatter).
9572+
kdpoint = (hoverSeries.directTouch && hoverPoint) || (hoverSeries && hoverSeries.searchPoint(e));
95569573
}
95579574

9558-
// Refresh tooltip for kdpoint
9559-
if (kdpoint && kdpoint !== hoverPoint) {
9575+
// Refresh tooltip for kdpoint if new hover point or tooltip was hidden // #3926
9576+
if (kdpoint && (kdpoint !== hoverPoint || (tooltip && tooltip.isHidden))) {
95609577
// Draw tooltip if necessary
95619578
if (shared && !kdpoint.series.noSharedTooltip) {
95629579
i = kdpoints.length;
95639580
trueXkd = kdpoint.clientX;
95649581
while (i--) {
95659582
trueX = kdpoints[i].clientX;
9566-
if (kdpoints[i].x !== kdpoint.x || trueX !== trueXkd || !defined(kdpoints[i].y) || (kdpoints[i].series.noSharedTooltip || false)) {
9583+
if (kdpoints[i].x !== kdpoint.x || trueX !== trueXkd || (kdpoints[i].series.noSharedTooltip || false)) {
95679584
kdpoints.splice(i, 1);
95689585
}
95699586
}
9570-
if (tooltip) {
9587+
if (kdpoints.length && tooltip) {
95719588
tooltip.refresh(kdpoints, e);
95729589
}
9590+
9591+
// do mouseover on all points except the closest
95739592
each(kdpoints, function (point) {
9574-
point.onMouseOver(e);
9575-
});
9593+
if (point !== kdpoint) {
9594+
point.onMouseOver(e);
9595+
}
9596+
});
9597+
kdpoint.onMouseOver(e); // #3919 do mouseover on the closest point last to ensure it is the hoverpoint
95769598
} else {
9577-
if (tooltip) {
9599+
if (tooltip) {
95789600
tooltip.refresh(kdpoint, e);
95799601
}
9580-
kdpoint.onMouseOver(e);
9602+
kdpoint.onMouseOver(e);
95819603
}
95829604

95839605
// Update positions (regardless of kdpoint or hoverPoint)
@@ -9592,7 +9614,9 @@ Pointer.prototype = {
95929614
// Start the event listener to pick up the tooltip
95939615
if (tooltip && !pointer._onDocumentMouseMove) {
95949616
pointer._onDocumentMouseMove = function (e) {
9595-
pointer.onDocumentMouseMove(e);
9617+
if (charts[hoverChartIndex]) {
9618+
charts[hoverChartIndex].pointer.onDocumentMouseMove(e);
9619+
}
95969620
};
95979621
addEvent(doc, 'mousemove', pointer._onDocumentMouseMove);
95989622
}
@@ -9968,6 +9992,7 @@ Pointer.prototype = {
99689992
plotTop = chart.plotTop;
99699993

99709994
e = this.normalize(e);
9995+
e.originalEvent = e; // #3913
99719996
e.cancelBubble = true; // IE specific
99729997

99739998
if (!chart.cancelClick) {
@@ -11900,7 +11925,7 @@ Chart.prototype = {
1190011925

1190111926
// Width and height checks for display:none. Target is doc in IE8 and Opera,
1190211927
// win in Firefox, Chrome and IE9.
11903-
if (!chart.hasUserSize && width && height && (target === win || target === doc)) {
11928+
if (!chart.hasUserSize && !chart.isPrinting && width && height && (target === win || target === doc)) { // #1093
1190411929
if (width !== chart.containerWidth || height !== chart.containerHeight) {
1190511930
clearTimeout(chart.reflowTimeout);
1190611931
if (e) { // Called from window.resize
@@ -14256,7 +14281,7 @@ Series.prototype = {
1425614281
series[graphKey] = series.chart.renderer.path(graphPath)
1425714282
.attr(attribs)
1425814283
.add(series.group)
14259-
.shadow(!i && options.shadow);
14284+
.shadow((i < 2) && options.shadow); // add shadow to normal series (0) or to first zone (1) #3932
1426014285
}
1426114286
});
1426214287
},
@@ -14550,6 +14575,7 @@ Series.prototype = {
1455014575
var series = this,
1455114576
chart = series.chart,
1455214577
wasDirtyData = series.isDirtyData, // cache it here as it is set to false in render, but used after
14578+
wasDirty = series.isDirty,
1455314579
group = series.group,
1455414580
xAxis = series.xAxis,
1455514581
yAxis = series.yAxis;
@@ -14571,11 +14597,12 @@ Series.prototype = {
1457114597

1457214598
series.translate();
1457314599
series.render();
14574-
1457514600
if (wasDirtyData) {
14576-
delete this.kdTree; // #3868 recalculate the kdtree with dirty data
1457714601
fireEvent(series, 'updatedData');
1457814602
}
14603+
if (wasDirty || wasDirtyData) { // #3945 recalculate the kdtree when dirty
14604+
delete this.kdTree; // #3868 recalculate the kdtree with dirty data
14605+
}
1457914606
},
1458014607

1458114608
/**
@@ -14629,9 +14656,12 @@ Series.prototype = {
1462914656
}
1463014657
}
1463114658

14632-
// Start the recursive build process with a clone of the points array (#3873)
14659+
// Start the recursive build process with a clone of the points array and null points filtered out (#3873)
1463314660
function startRecursive() {
14634-
series.kdTree = _kdtree(series.points.slice(), dimensions, dimensions);
14661+
var points = grep(series.points, function (point) {
14662+
return point.y !== null;
14663+
});
14664+
series.kdTree = _kdtree(points, dimensions, dimensions);
1463514665
}
1463614666

1463714667
delete series.kdTree;
@@ -15195,7 +15225,7 @@ extend(Point.prototype, {
1519515225
chart.isDirtyBox = true;
1519615226
}
1519715227

15198-
if (seriesOptions.legendType === 'point') { // #1831, #1885
15228+
if (chart.legend.display && seriesOptions.legendType === 'point') { // #1831, #1885, #3934
1519915229
series.updateTotals();
1520015230
chart.legend.clearItems();
1520115231
}
@@ -17535,7 +17565,7 @@ if (seriesTypes.column) {
1753517565

1753617566

1753717567
/**
17538-
* Highcharts JS v4.1.3 (2015-02-27)
17568+
* Highcharts JS v4.1.4 (2015-03-10)
1753917569
* Highcharts module to hide overlapping data labels. This module is included by default in Highmaps.
1754017570
*
1754117571
* (c) 2010-2014 Torstein Honsi
@@ -17649,10 +17679,6 @@ var TrackerMixin = Highcharts.TrackerMixin = {
1764917679
var target = e.target,
1765017680
point;
1765117681

17652-
if (chart.hoverSeries !== series) {
17653-
series.onMouseOver();
17654-
}
17655-
1765617682
while (target && !point) {
1765717683
point = target.point;
1765817684
target = target.parentNode;
@@ -18046,6 +18072,10 @@ extend(Point.prototype, {
1804618072
tooltip = chart.tooltip,
1804718073
hoverPoint = chart.hoverPoint;
1804818074

18075+
if (chart.hoverSeries !== series) {
18076+
series.onMouseOver();
18077+
}
18078+
1804918079
// set normal state to previous series
1805018080
if (hoverPoint && hoverPoint !== point) {
1805118081
hoverPoint.onMouseOut();

app/assets/javascripts/highcharts/adapters/standalone-framework.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Highcharts JS v4.1.3 (2015-02-27)
2+
* @license Highcharts JS v4.1.4 (2015-03-10)
33
*
44
* Standalone Highcharts Framework
55
*

app/assets/javascripts/highcharts/highcharts-3d.js

+14-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @compilation_level SIMPLE_OPTIMIZATIONS
33

44
/**
5-
* @license Highcharts JS v4.1.3 (2015-02-27)
5+
* @license Highcharts JS v4.1.4 (2015-03-10)
66
*
77
* (c) 2009-2013 Torstein Hønsi
88
*
@@ -579,16 +579,21 @@ Highcharts.wrap(Highcharts.Chart.prototype, 'redraw', function (proceed) {
579579
proceed.apply(this, [].slice.call(arguments, 1));
580580
});
581581

582-
// Draw the series in the reverse order (#3803)
583-
Highcharts.Chart.prototype.renderSeries = function () {
584-
var serie,
582+
// Draw the series in the reverse order (#3803, #3917)
583+
Highcharts.wrap(Highcharts.Chart.prototype, 'renderSeries', function (proceed) {
584+
var series,
585585
i = this.series.length;
586-
while (i--) {
587-
serie = this.series[i];
588-
serie.translate();
589-
serie.render();
586+
587+
if (this.is3d()) {
588+
while (i--) {
589+
series = this.series[i];
590+
series.translate();
591+
series.render();
592+
}
593+
} else {
594+
proceed.call(this);
590595
}
591-
};
596+
});
592597

593598
Highcharts.Chart.prototype.retrieveStacks = function (stacking) {
594599
var series = this.series,

0 commit comments

Comments
 (0)