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

Using sampling with connectNulls connects regular datapoints with null ones when zoomed out #14689

Closed
tmscer opened this issue Apr 16, 2021 · 12 comments · Fixed by #16431
Closed
Labels
bug en This issue is in English resolved topic: line

Comments

@tmscer
Copy link

tmscer commented Apr 16, 2021

Version

5.1.0

Reproduction link

https://codepen.io/tmscer/pen/wvgxKNR
https://codepen.io/tmscer/pen/yLgGXbo

Steps to reproduce

Use a series line with connectNulls: false and sampling: 'lttb' (may be reproducible with other sampling methods) and have a null value in your data.

What is expected?

I'd expect null values to never be connected with regular values.

What is actually happening?

When zoomed out, regular values are connected with null values. When zoomed in, the line between regular values and nulls disappears and behaves as expected.


I suspect this may be caused by the sampling algorithm since when no sampling is used, null values are never connected with regular ones.

I'm not sure what version of Echarts is used in the codepen, however, the bug is reproducible in 5.1.0. To see the bug, zoom in the flat line. At the end of it, there is a null.

@echarts-bot
Copy link

echarts-bot bot commented Apr 16, 2021

Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to [email protected]. Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe our mailing list.

Have a nice day! 🍵

@echarts-bot echarts-bot bot added bug en This issue is in English pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Apr 16, 2021
@tmscer
Copy link
Author

tmscer commented Apr 16, 2021

Images

When zoomed out

2021-04-16_20-45-59

When zoomed in

2021-04-16_20-46-07

@tmscer tmscer changed the title Using sampling with connectNulls connects Using sampling with connectNulls connects regular datapoints with null ones when zoomed out Apr 16, 2021
@pissang pissang added this to the 5.2.0 milestone Apr 20, 2021
@echarts-bot
Copy link

echarts-bot bot commented Apr 23, 2021

@tmscer Please simplify your demo to help us debug.

A minimum reproducible demo should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.

@Ovilia Ovilia added the missing-demo The author should provide a demo. label Apr 23, 2021
@tmscer
Copy link
Author

tmscer commented Apr 23, 2021

I've simplified the demo. I removed as much as possible, however, some data (~1600 datapoints) is left in the demo to actually see the bug. See https://codepen.io/tmscer/pen/yLgGXbo.

There is a null value on line 634 with which other datapoints shouldn't be connected. I suspect sampling may play a role since once removed, the null value is no longer connected. Zooming, as per issue's first comment, disconnects the null datapoint.

Let me know if the demo is simple enough. But I am afraid that further significant simplification isn't possible.

@Ovilia
Copy link
Contributor

Ovilia commented Apr 23, 2021

@tmscer Thanks. I think we can get on it based on this.

@Ovilia Ovilia added topic: line and removed missing-demo The author should provide a demo. pending We are not sure about whether this is a bug/new feature. labels Apr 23, 2021
@OrestHk
Copy link

OrestHk commented Apr 23, 2021

Hi !
First of all thx for the library, started using it this week ! It's just awesome ! Easy to use, with customization and performance !

I'm having a similar issue in my project
https://codepen.io/test45/pen/RwKEBqN. Here's another sample if it can help ! With a bit more holes (null values)
The unwanted behaviour can be seen zooming a bit in the chart and moving the x absis

As for Tmscer example, the problem seems only to appear when using LTTB sampling method, and when the algorithm is applied to the serie. When the zoom level allow to display all points on the chart, the problem disappear. Guess it as something to do with the algorithm handling null / undefined values in the serie.

Sorry if the english is a bit messy !
And thanks again for your work !

@tmscer
Copy link
Author

tmscer commented Sep 1, 2021

I see that 5.2.0 has been released, should the milestone be updated or is it possible that this bug will be fixed in some 5.2.x?

@tmscer
Copy link
Author

tmscer commented Oct 1, 2021

@Ovilia.

@chenlijun99
Copy link

I reported the same issue in #13228

@sglvladi
Copy link

Hi there! Any updates on this?

@pissang pissang modified the milestones: 5.2, 5.4 Jan 20, 2022
@pissang
Copy link
Contributor

pissang commented Jan 20, 2022

Seems it's because the null values are filtered during sampling

@tmscer
Copy link
Author

tmscer commented Jan 23, 2022

Seems it's because the null values are filtered during sampling

An idea: a null value should then split the dataseries into separate chunks that can be then sampled separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English resolved topic: line
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants