-
Notifications
You must be signed in to change notification settings - Fork 121
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
Stacked bar charts do not render correctly with Positive / Negative Values #1280
Comments
See reproduction codesandbox |
@nickofthyme yep you are right, positive bars should be stacked with positive ones, negative with negative ones. @monfera do you see any drawback? |
Indeed if we decide to support this "gross type" of stacking, all positives should be above zero and all negatives below zero. But it's not a good visualization in my opinion to begin with. Even something like a clustered bar chart, with every second bar showing negatives/positives for the same bin would be an improvement. Waterfall chart would be better, though we have no support for it right now |
More examples from this cross Kibana issue: As shown in the pictures, the order of the series matter, while the example from @nickofthyme seems more robust, to me. |
Resolves issue with stacking a mix of negative and positive bars and areas for any `StackMode`. Key changes include: - Disallowing stacked band charts (i.e. using `stackAccessors` with `y0Accessors`). Now shows `console.warn` when used and ignores `y0Accessor` for rendering but still adds to `initialY0` value. - Blocks showing banded legend and tooltip values for banded stacks, see case above. - Prevents percentage domain constraining when no `stackAccessors` are specified. fix #1280
# [40.2.0](v40.1.0...v40.2.0) (2021-12-09) ### Bug Fixes * **partition:** linkLabel textColor override ([#1498](#1498)) ([3013310](3013310)) * **waffle:** use descend sortPredicate by default ([#1510](#1510)) ([763e2e3](763e2e3)) * **xy:** stacked polarity ([#1502](#1502)) ([920666a](920666a)), closes [#1280](#1280) ### Features * **xy:** expose style for interpolation fit functions ([#1505](#1505)) ([3071457](3071457))
Resolves issue with stacking a mix of negative and positive bars and areas for any `StackMode`. Key changes include: - Disallowing stacked band charts (i.e. using `stackAccessors` with `y0Accessors`). Now shows `console.warn` when used and ignores `y0Accessor` for rendering but still adds to `initialY0` value. - Blocks showing banded legend and tooltip values for banded stacks, see case above. - Prevents percentage domain constraining when no `stackAccessors` are specified. fix elastic#1280 # Conflicts: # packages/charts/src/chart_types/xy_chart/rendering/area.ts
Resolves issue with stacking a mix of negative and positive bars and areas for any `StackMode`. Key changes include: - Disallowing stacked band charts (i.e. using `stackAccessors` with `y0Accessors`). Now shows `console.warn` when used and ignores `y0Accessor` for rendering but still adds to `initialY0` value. - Blocks showing banded legend and tooltip values for banded stacks, see case above. - Prevents percentage domain constraining when no `stackAccessors` are specified. fix #1280
Resolves issue with stacking a mix of negative and positive bars and areas for any `StackMode`. Key changes include: - Disallowing stacked band charts (i.e. using `stackAccessors` with `y0Accessors`). Now shows `console.warn` when used and ignores `y0Accessor` for rendering but still adds to `initialY0` value. - Blocks showing banded legend and tooltip values for banded stacks, see case above. - Prevents percentage domain constraining when no `stackAccessors` are specified. fix elastic#1280 # Conflicts: # integration/tests/__image_snapshots__/axis-stories-test-ts-axis-stories-should-switch-to-a-30-minute-raster-1-snap.png # packages/charts/src/chart_types/xy_chart/rendering/area.ts # packages/charts/src/chart_types/xy_chart/utils/stacked_series_utils.ts
Describe the bug
Stacked bar charts do not render correctly with Positive / Negative Values
Also see Discuss Here
To Reproduce
Steps to reproduce the behavior:
Add the sample data below
Create a Non-Stacked and Stacked Lens Visualizations
Observe Correct Non-Stacked Bar Chart
Observer Incorrect Stacked Chart
Expected behaviour
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Version (please complete the following information):
Sample Data
Non Stacked Chart Looks Correct
Stacked Chart is Not Correct. It should look the same as above bu on the same line / category.
The text was updated successfully, but these errors were encountered: