-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[charts] support partial dashed line path for incomplete or projected data points #13140
Comments
great request @ohmsl ... I did add this to the board for the team to have a look 👍🏼 |
For linear curve it works without any issue with the same technic: create a second line a style it: https://codesandbox.io/p/sandbox/cold-rain-z8vxd7?file=%2Fsrc%2FDemo.tsx%3A14%2C11 For line chart with more complex curve it might be a more complex topic. |
@alexfauquette thanks, perfect solution for now as I'm using a linear line anyway. What are your thoughts of making this a built in feature though? |
For sure, we could add a props |
|
Same issue occurs in the example you provided. Except rewriting the tooltip content, I don't see other solution. To do so, you can use the slots, and for inspiration here is the default content. I assume you can create a similar component that only show the one you want to display |
Yeah I noticed that too. I'll have a look at making a custom tooltip. Imagining you further build in support for utilising the chart in this way, perhaps you implement a way of de-duping series if they have the same id, label or something? And just to confirm, have you made any plans to implement fixes/features for any of the above stuff mentioned, just so I know what to expect in future releases. Appreciate the reference and info you provided so far! |
For the About the timeline, I've no idea. It will depends of the team bandwidth |
I don't mind sharing my solution to the problem if/when I get it. Appreciate the help! Regarding this issue, shall we consider it closed? x |
I would prefer to keep it open as long to trak the need. Will close it when we add a demonstration |
Running into an issue when it comes to stacked line charts.
The solution probably involves some sort of "substack" feature.
|
The root cause of all those sub issues if that we tweak the data provided to the chart for a rendering purpose. Here are two solution to customize the line rendering to introduce a notion of limit. The idea is to render 2 lines with two styles and clip them. The draw back is that tooltip and other components will not be aware that those are extrapolated data. https://codesandbox.io/p/sandbox/admiring-varahamihira-mn8hlt?file=%2Fsrc%2FDemo.tsx%3A171%2C2 @JCQuintas What do you think about creating a demo with the first solution? |
Really appreciate this sandbox @alexfauquette. Fully solves my issue! |
@alexfauquette Solution seems really nice. What do you think about providing a
This is something that I'm interested in improving. We should provide a lot more data to allow the customisation of tooltips, labels, anything really 😅 Right now, you could do something like: series={[
{
type: "line",
data: [1, 2, 3, 4, 1, 2, 3, 4, 5],
valueFormatter: (v, i) =>
`${v}${i.dataIndex > 5 ? " (estimated)" : ""}`,
},
]} |
@ohmsl: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Summary
In the case of a real-time analytics dashboard, the historic data you see is concrete. However, incomplete data, such as the data points for today or projected data points are not. Therefore it would be beneficial to have some way of denoting what points are complete, and what points are not. In my case this would be a "dashed" line between the last concrete point and the incomplete point today. Specifically on the line chart, though I believe similar cases should be accounted for on other charts.
Examples
This particular implementation is seen on Vercel's analytics dashboard. A screenshot below of my own websites analytics:
Note the last data point.
I looked up how it's done in visx (the charting lib vercel use) and came across this jsfiddle
Search keywords: dashed line path, incomplete data points
The text was updated successfully, but these errors were encountered: