-
Notifications
You must be signed in to change notification settings - Fork 59
Component | Line: Allow lines to be stacked (combine with stacked areas) #690
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
base: main
Are you sure you want to change the base?
Conversation
@aguingand thanks for the contribution, I think I prefer the current solution
|
|
I feel like this will require hacking the behavior of Crosshair, and I'm not sure how I feel about it. Adding a set of |
|
@rokotyan I'm also leaning towards line config in area solution, it's also simpler DX (one component instead of 2 to add a stroke to already existing shapes). I will open another PR. |
How is that differ from how we handle area and stacked bar? You should be able to just pass |
@lee00678 There will be a problem with Crosshair circles. We don't want to show circles for the lines in this case since they are purely decorative, and this will require some hacking. |
I see. Ok, then maybe we should consider these as separate features. I still see having stacked line a valid addition to the library. |
@lee00678 Could you elaborate on that a bit more? Specifically, what use cases do you see for a stacked line chart? I'm afraid it might bring more confusion than benefits, and extra code to maintain. |
Yes, I think for cases like undefined/null data, we can use interpolated lines to indicate that, whereas area chart doesn't provide that functionality. |
|
@lee00678 You mean if we use it with Area? I get your point, but this will have problems with Crosshair that I described above. I don't mind merging this if we implement a way to opt-out a component from working with Crosshair and provide a public example. |
Problem
Today we can put lines over classic areas (same y) but not over stacked area (stacked y). It can be useful for some design systems (e.g. https://www.shadcn-vue.com/charts/area#charts).
Solution
Add a
stackedboolean config for Line component.Todo
getCirclesconfig to Crosshair.Alternative solution
Another solution would be to add a
lineconfig to Area but it seems less configurable.