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

Step charts #586

Open
kasparthommen opened this issue May 20, 2024 · 1 comment
Open

Step charts #586

kasparthommen opened this issue May 20, 2024 · 1 comment

Comments

@kasparthommen
Copy link

What is the feature ?

An option to plot step charts, analogous to e.g. https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.step.html

(Optional) Why this feature is useful and how people would use the feature ?

Because linear interpolation between data points isn't necessarily the correct way to connect two data points. If the price of a stock is 100 at t=0 and at t=10 it changes to 103, then it was 100 for all 0 <= t < 10, i.e, it didn't gradually rise to 103 but it did so in a step change.

@LPardue
Copy link

LPardue commented Nov 25, 2024

I have a need for this feature. As the OP states, the linear interpolation doesn't reflect any reality for some kinds of data, which can be very misleading.

My current workaround is to manually add points to force a step interpolation, which is cumbersome and expensive for plots with lots of points.

E.g., for points A, B, C on an x/y chart, I have

xa, ya,
xb, ya,
xb, yb,
xc, yb,
xc, yc,

I'd really like for the interpolation style to be an option in the LineSeries.

As a point of reference, Graphana offers 4 choices for interpolation

Choose how the graph interpolates the series line:

Linear - Points are joined by straight lines.
Smooth - Points are joined by curved lines that smooths transitions between points.
Step before - The line is displayed as steps between points. Points are rendered at the end of the step.
Step after - The line is displayed as steps between points. Points are rendered at the beginning of the step.

image

Graphana's smooth fitting is probably already tracked under #170

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

No branches or pull requests

2 participants