Skip to content

Commit

Permalink
Fixed #6566, zAxis wasn't updated through chart.update().
Browse files Browse the repository at this point in the history
  • Loading branch information
Kacper Madej authored and TorsteinHonsi committed Apr 18, 2017
1 parent 83d6587 commit c20bad7
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/parts/Dynamics.js
Expand Up @@ -291,7 +291,8 @@ extend(Chart.prototype, /** @lends Highcharts.Chart.prototype */ {
// update the first series in the chart. Setting two series without
// an id will update the first and the second respectively (#6019)
// chart.update and responsive.
each(['xAxis', 'yAxis', 'series', 'colorAxis', 'pane'], function (coll) {
each(['xAxis', 'yAxis', 'zAxis',
'series', 'colorAxis', 'pane'], function (coll) {
if (options[coll]) {
each(splat(options[coll]), function (newOptions, i) {
var item = (
Expand Down
5 changes: 5 additions & 0 deletions samples/unit-tests/3d/zaxis-update/demo.details
@@ -0,0 +1,5 @@
---
resources:
- https://code.jquery.com/qunit/qunit-2.0.1.js
- https://code.jquery.com/qunit/qunit-2.0.1.css
...
7 changes: 7 additions & 0 deletions samples/unit-tests/3d/zaxis-update/demo.html
@@ -0,0 +1,7 @@
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-3d.js"></script>

<div id="qunit"></div>
<div id="qunit-fixture"></div>

<div id="container"></div>
39 changes: 39 additions & 0 deletions samples/unit-tests/3d/zaxis-update/demo.js
@@ -0,0 +1,39 @@
QUnit.test('zAxis update through chart.update() (#6566)', function (assert) {
var chart = Highcharts.chart('container', {
chart: {
type: 'scatter',
options3d: {
enabled: true
}
},
zAxis: {
min: 10,
max: 20
},
series: [{
data: [
[5, 5, 5],
[10, 10, 10],
[15, 15, 15],
[20, 20, 20],
[25, 25, 25]
]
}]
});

chart.update({
zAxis: {
min: 0,
max: 30,
labels: {
enabled: false
}
}
});

assert.strictEqual(
chart.series[0].points[0].isInside && chart.series[0].points[4].isInside,
true,
'zAxis updated'
);
});

0 comments on commit c20bad7

Please sign in to comment.