Skip to content

Commit

Permalink
Merge pull request highcharts#22112 from highcharts/bugfix/20687-seri…
Browse files Browse the repository at this point in the history
…es-keys-update

Fixed highcharts#20687, series.update with keys did not work
  • Loading branch information
TorsteinHonsi authored Nov 6, 2024
2 parents 6c137a8 + 115d353 commit e4cd88e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions samples/unit-tests/series/update/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,25 @@ QUnit.test('Series.update and setData', function (assert) {
true,
'Custom property should be available in options after update (#11244)'
);

chart.series[0].update({
keys: ['x', 'name', 'y'],
data: [
[0, 'First', 20]
]
});

assert.strictEqual(
chart.series[0].points[0].y,
20,
'The point value should be updated when using keys'
);

assert.strictEqual(
chart.series[0].points[0].name,
'First',
'The point name should be updated when using keys'
);
});

QUnit.test(
Expand Down
1 change: 1 addition & 0 deletions ts/Core/Series/Series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4232,6 +4232,7 @@ class Series {
// New type requires new point classes
(newType && newType !== this.type) ||
// New options affecting how the data points are built
typeof options.keys !== 'undefined' ||
typeof options.pointStart !== 'undefined' ||
typeof options.pointInterval !== 'undefined' ||
typeof options.relativeXValue !== 'undefined' ||
Expand Down

0 comments on commit e4cd88e

Please sign in to comment.