Skip to content
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

fix(Highcharts plugin): fix updating point x value #121

Merged
merged 1 commit into from
Feb 8, 2023
Merged

Conversation

Flunt1k
Copy link
Contributor

@Flunt1k Flunt1k commented Feb 8, 2023

A problem arises when the graph has 2 or more series and you need to update the points. When the point.update function is called, the value of x is updated to the index in the flat array.

For example, the graph has 2 series: s1 = [{y: 10}, {y: 15}, {y: 42}], s2 =[{y: null}, {y: 12}, {y: null}], and some categories like ['A', 'B', 'C'].

Before point.update Highcharts has this point representation s1 = [{y: 10, x: 0}, {y: 15, x: 1}, {y: 42, x: 2}], s2 =[{y: null, x: 0}, {y: 12, x: 1}, {y: null, x: 2}]. In this case, x means the index of the category array, I suppose.

Then after updating, the value of the point x changes s1 = [{y: 10, x: 0}, {y: 15, x: 1}, {y: 42, x: 2}], s2 =[{y: null, x: 3}, {y: 12, x: 4}, {y: null, x: 5}].

Highcharts seems to set the index from the merged data as if it were a flat array [{y: 10, x: 0}, {y: 15, x: 1}, {y: 42, x: 2}, {y: null, x: 3}, {y: 12, x: 4}, {y: null, x: 5}].

I added point.x to the update function to save information about the value of x.

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@Flunt1k
Copy link
Contributor Author

Flunt1k commented Feb 8, 2023

@Flunt1k Flunt1k merged commit 0ffe89f into main Feb 8, 2023
@korvin89 korvin89 deleted the fix-point-update branch June 26, 2023 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants