New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heatmap addData 6.1.2 not updating correctly. #8995

Closed
garybrain opened this Issue Sep 18, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@garybrain

garybrain commented Sep 18, 2018

Expected behaviour

Ajax addData should update the Heatmap with new data.

Actual behaviour

graph update deformed on update.

Live demo with steps to reproduce

Working with 6.0.3 : http://jsfiddle.net/gvnLu3f8/4/ ( Alexander / Tuesday = 100 )
No working using 6.1.0 to current : http://jsfiddle.net/gvnLu3f8/3/

Product version

Highcharts v6.1.2 (2018-08-31)

Affected browser(s)

All.

@KacperMadej

This comment has been minimized.

Show comment
Hide comment
@KacperMadej

KacperMadej Sep 18, 2018

Contributor

Hi @garybrain

Thank you for reporting about the regression.

Last working version is 6.0.7.
Broken since version 6.1.0.
Offending commit 7a74166

As a workaround please use version 6.0.7

Contributor

KacperMadej commented Sep 18, 2018

Hi @garybrain

Thank you for reporting about the regression.

Last working version is 6.0.7.
Broken since version 6.1.0.
Offending commit 7a74166

As a workaround please use version 6.0.7

@KacperMadej KacperMadej self-assigned this Sep 18, 2018

@KacperMadej

This comment has been minimized.

Show comment
Hide comment
@KacperMadej

KacperMadej Sep 18, 2018

Contributor

Simplified demo: http://jsfiddle.net/BlackLabel/rbkv9d2a/

Details of the problem:
Points are wrongly expected to have unique x values. Some series types like heatmap, scatter, etc. might not have unique x values.

Code causing the problem:

highcharts/js/parts/Series.js

Lines 3095 to 3097 in 93d9d51

// Search for the same X in the existing data set
pointIndex = H.inArray(x, this.xData, lastIndex);

Workaround:

Use series.setData with updatePoints argument set to false.

Simple demo with the workaround: http://jsfiddle.net/BlackLabel/rbkv9d2a/1/
Original demo with the workaround: http://jsfiddle.net/BlackLabel/gvnLu3f8/6/

Contributor

KacperMadej commented Sep 18, 2018

Simplified demo: http://jsfiddle.net/BlackLabel/rbkv9d2a/

Details of the problem:
Points are wrongly expected to have unique x values. Some series types like heatmap, scatter, etc. might not have unique x values.

Code causing the problem:

highcharts/js/parts/Series.js

Lines 3095 to 3097 in 93d9d51

// Search for the same X in the existing data set
pointIndex = H.inArray(x, this.xData, lastIndex);

Workaround:

Use series.setData with updatePoints argument set to false.

Simple demo with the workaround: http://jsfiddle.net/BlackLabel/rbkv9d2a/1/
Original demo with the workaround: http://jsfiddle.net/BlackLabel/gvnLu3f8/6/

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Sep 19, 2018

Collaborator

I think the entire code block if (isNumber(x)) { should only run if requireSorting. What do you think @KacperMadej?

if (requireSorting && isNumber(x)) {

Collaborator

TorsteinHonsi commented Sep 19, 2018

I think the entire code block if (isNumber(x)) { should only run if requireSorting. What do you think @KacperMadej?

if (requireSorting && isNumber(x)) {

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Sep 19, 2018

Collaborator

Besides, we should be able to make soft updates (with animation) by using point.id instead of linking the points by x.

Collaborator

TorsteinHonsi commented Sep 19, 2018

Besides, we should be able to make soft updates (with animation) by using point.id instead of linking the points by x.

@KacperMadej

This comment has been minimized.

Show comment
Hide comment
@KacperMadej

KacperMadej Sep 19, 2018

Contributor

@TorsteinHonsi
I wanted to write suggested changes, but it started to look like a very long text. Instead, I prepared a commit and I'll create a PR in few minutes, so you could comment directly on code.

Contributor

KacperMadej commented Sep 19, 2018

@TorsteinHonsi
I wanted to write suggested changes, but it started to look like a very long text. Instead, I prepared a commit and I'll create a PR in few minutes, so you could comment directly on code.

@garybrain

This comment has been minimized.

Show comment
Hide comment
@garybrain

garybrain Sep 19, 2018

Hi, the workaround got me past the problem so many thanks for the quick reply.

G.

garybrain commented Sep 19, 2018

Hi, the workaround got me past the problem so many thanks for the quick reply.

G.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment