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

Plot discontinuous lines #332

Open
TodeDragos opened this issue Apr 11, 2024 · 4 comments
Open

Plot discontinuous lines #332

TodeDragos opened this issue Apr 11, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@TodeDragos
Copy link

Question

Hello,

I'm currently using the Chart class to plot a line chart for a time series data. However, I've encountered an issue when trying to plot a line that has gaps (i.e., discontinuous line).

Here's a simplified version of my code:

chart = Chart()
bid1_line = chart.create_line('bid1_line', width=1, color='#FF0000')
data = df[['time', 'bid1_line']].dropna()
bid1_line.set(data)

In my data, there are periods where 'bid1_line' is NaN, and I would like these periods to appear as gaps in the line chart. However, the current implementation seems to connect the points before and after the gap, creating the impression of a continuous line.

I was wondering if there's a way to create a broken line chart using the Chart class? If not, could this feature be considered for a future update?

Thank you for your help.

Code example

No response

@louisnw01 louisnw01 added the enhancement New feature or request label May 6, 2024
@Baili-BL
Copy link

Hi, I also encountered the same situation. I checked and found that when I zoom in, I can occupy non continuous lines, but when I zoom out, it shows continuous lines. By the way, have you solved this problem? If there is a good solution, can you share it?

@LukeZhuohuiLi
Copy link

I changed the line style, still doesn't solve the problem.

@TodeDragos
Copy link
Author

nope, unfortunately, I couldn't find any solution for this behavior.

@LukeZhuohuiLi
Copy link

LukeZhuohuiLi commented May 15, 2024

I just solved this by spliting the series, put them into two lists, and drawing them one by one using two for loops. Stupid but works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants