Open asahlin opened 5 years ago
One possible fix is to not calculate null values in the bar width calculations? In my case, only 1 dataset will have a value for each bar, so technically it could /should be full width allowed (not divided by 3)
Thanks @asahlin 👍
@theiliad Is that is something that will addressed? This is what our customers are seeing
Hey @asahlin. We should really address this issue asap IMO.
I'm going to get design involved to see if your proposed solution would be ideal for us to go through with, then we can quickly implement a fix.
@shixiedesign @cameroncalder
@theiliad how was this fixed? Aaron and I migrated to the new tabular data format, and i still see the same problem:
see this: https://codesandbox.io/s/crazy-khayyam-xmvcr
we;re using the bar charts to show safe/warning/error levels for certain metrics. Which means for a certain dataset, only one key will have a value, the others will be 0. we'd like for the bar to be centered and ignore the ones that have 0, Aaron explains it better above
on the sandbox example, you can tell that the "warning" yellow dataset is centered because it's the 2nd group, but the safe one (green) is on the left side. we'd like all the bars to be consistent regardless of the grouping.
Appears to still be an issue in the latest... https://codesandbox.io/s/focused-resonance-x8yw5w?file=/src/index.js
I am submitting a...
charts version: 0.10.2
Issue description: I have bar chart with grouped data, when their is only one value (one bar) the bar is not centered on the x-axis
Steps to produce the issue: Supply multiply datasets to bar chart, with only have one value code example: if (tempValue > 90) { dataSafeLevel.push(null); dataWarningLevel.push(null); dataNeedsActionLevel.push(tempValue); } else if (tempValue > 50) { dataSafeLevel.push(null); dataWarningLevel.push(tempValue); dataNeedsActionLevel.push(null); } else { dataSafeLevel.push(tempValue); dataWarningLevel.push(null); dataNeedsActionLevel.push(null); } });
Current behavior: Single bar does not line up
Expected behavior: Bar is centered
Screenshot or recording![image](https://user-images.githubusercontent.com/13006634/53976878-811ac780-40cd-11e9-9999-eb813492000d.png)
showing array with values & nulls in each index.![image](https://user-images.githubusercontent.com/13006634/53977059-d060f800-40cd-11e9-8c8a-25e4cf758348.png)