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

Segment functionality doesn't work for time axis or for data in not primitive form #9401

Closed
PavolSvidran opened this issue Jul 13, 2021 · 3 comments · Fixed by #9447
Closed

Comments

@PavolSvidran
Copy link

PavolSvidran commented Jul 13, 2021

Hi, yesterday i asked about some functionality described in #9396, response is fine and in theory it is what i need.

When i tried this segment solution i cannot make it work. I am using combination of time scale and data is in object form with props x,y where x is parsed from string. I tried to simulate it and my conclusion is that it realy doesnt work or there is somethink what i missed.

In the demo linked below, you can see two charts, where first one is with time x-scale and second with normal. Both have almost same config and as you can see in the first one it doesn't work. For both charts is segment function called, but only one respect it.

Demo: https://codepen.io/jBeater/pen/GRmoaYz

Browser: Chrome
ChartJS: 4.3.1

@kurkle
Copy link
Member

kurkle commented Jul 13, 2021

The line is split in segments when the style changes. Your pen does not have any different styles.

So if you really have some segments, it works: https://codepen.io/kurkle/pen/OJmbYrO

The difference between the two charts is the NaN point that forces a break.

That different behavior should still be considered as a bug though.

@PavolSvidran
Copy link
Author

PavolSvidran commented Jul 13, 2021

Yea i think that segment should be every line between two points to allow customziations just like that i asked in #9396.
For now i dont know how to solve that issue, because my chart contains a lot of points, BE change is a lot of work (FE calculations, backward compatibility of cache, custom plugins update, etc.) and FE adjust of datasets is too much performance loss.

NaN for me means data loss in that point, not a segment change to allow customization :(

@etimberg
Copy link
Member

It sounds like this would be solved by exposing the index of each point as #8985 requested. That way, the style functions could know where they are in the line.

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

Successfully merging a pull request may close this issue.

3 participants