LabelSeries with Stacked Vertical Bar Series
Hi, I have some issues with labelSeries when using it with a vertical Bar Series (so stackby="y"). The label seem to always go way above the bars like that:

I've done a codepen to show my problem. https://codesandbox.io/s/5kx21nk77l
Is there a way to get around the problem or maybe i'm doing this the wrong way (i used this tutorial ) ? I've tried negative values and reverse the labelSeries position in the XYplot but i don't have consistent result ...
Hey @tmessaoudi,
I think you are doing what is fine, but you high a good point: stack should only stack like series. It doesn't make sense to stack labels and bars. I would welcome a PR addressing this!
As a workaround you can just put one XYPlot on top of your initial one and put all your labels and stuff in there. Alternatively you can stack the bars yourself (and not use the stack attribute at all) by using the y0 and y property , something like the usage here https://github.com/uber/react-vis/blob/master/showcase/plot/difference-chart.js
hi @mcnuttandrew , Got the same scenario in my project, where I've clustered stacked bars and I want to add label for each bar.
I'm wondering what is the correct solution here. (Got some SW Dev exp, but I'm really new to React/JS/Web Dev)
from my prespective, I think that the best solution would be to add the 'cluster' attribute to Label series. the problem with this solution is that the user will have to create the Labels series and Bars series in the same order. Otherwise I think that the calculation of stacked series will result in incorrect placing of labels and bars(i think it happens at getStackedData(), right?)
another solution would be to add 'title' or 'content' for Bar Series and to control its position within the Bar.
I guess you don't want to add more and more attributes so the components won't start to look like a giant dirty monsters, but this is what I came up with...
Do you have any other suggestions?
I still think the right long term solution is to make stack only affect common types of series, eg bars only stack with bars labels stack with labels.
Another work around would be to use the CustomSVGSeries and make each placed
I still think the right long term solution is to make stack only affect common types of series, eg bars only stack with bars labels stack with labels.
Sure, but it means that:
- 'cluster' attribute needs to part of Label series, otherwise the stacking will be done on the same "bin"
- If a user wants to add bars and to attach labels to them, he would have to create the data for the labels in the same order, the bars were created otherwise some labels would be misplaced.
p.s. - where the shift across x axis takes place? I mean how the clustering happens so that stacked bars of the same cluster are placed next to each other?