-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Negative and positive mixed stackbar. #835
Comments
Sorry for the late reply. It looks like we've never supported the use case of negative numbers in stacked bar charts. We might first solve it conceptually. For example what happens if you stack two series where they "cancel" each other out? I'm open for any suggestions. series: [
[100, 10, 5]
[-100, -10, -5]
] |
I actually need to do this for a current project. The idea is to combine a stacked bar chart with a line chart to create a profit/loss graph. The positive value would be sales, the negative value would be costs, and the line would be rendered as the difference between the two (found by adding them together). Given this example data:
I would render the first two sets as a stacked chart, and then render the last set as a line chart. I could mock something up if you need a visual of what I'm talking about (and/or create a new issue if it makes more sense than posting here). |
@gionkunz 100 to -100 will be a full height line. 10 to -10 a small line of 20 pixels height, and 5 to -5 a small 10 pixels line. Check this chart: |
Im currently in a middle of something, first i pass the two values on same serie like ({x:28, y: 37}) then on draw event i check the two value and replace elements:
|
Very similar issue as @tiesont here. For an example: Google Sheets handles this nicely. |
Need this too |
I try to make a stacked diagram with on one side a positive bar and on the otherside a negative bar. But they don't seem to work together. It feels like it works like oil. seems to be stacking wrongly for this usecase. What can I do? I used the code example of stacked bar and fiddled around wondering if I can make it happen but it seemed the Y value seems to be wrong:
See the fiddle:
https://jsfiddle.net/7qscekw6/
The text was updated successfully, but these errors were encountered: