Component | Line: Allow lines to be stacked (combine with stacked areas) - #690
Component | Line: Allow lines to be stacked (combine with stacked areas)#690aguingand wants to merge 2 commits into
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. |
I get your point for crosshair, I will think about it and see what's the best approach. |
|
Marking as Draft for now. |
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.