You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary
I'm using a BarChart in an app but sometimes when I re-draw it the bars width is not respected and I get inconsistent results (even though the amount of values in the X axis is always 100).
This is how I want it to look always:
but sometimes it looks like this:
Does anyone know why this happens and how can I force it to always look the same?
I'm already setting a bar width value like this but it doesn't help:
barChartView?.data?.barWidth =0.3f
Expected Behavior
The bars in the chart have the same width every time.
Device:
Device: Moto X 2nd gen
Android Version: 6.0
Library Version: 3.0.3
Additional Context
I think the issue has something to do with the range of values in the X axis, as the chart looks good when the range goes from 0 to 50 or similar, but it looks bad when the range is smaller (e.g. from 0 to 15 or 0 to 24).
The text was updated successfully, but these errors were encountered:
I will admit, I tried working with the bar width and gave up because it was too hard to make it look right. I've edited your issue and removed all the code, since the problem isn't really within your code, but with the confusing nature of the library on bar widths.
I think the width should be a basic DP value, with a spacing option either in DP as well or a percentage of the bar width. Right now you can only set the bar width in terms of "values" which is a fairly ambiguous term, and only allows you to go up to the distance between values before they start overlapping, not actual DP values, and it won't push the bars apart if you set the value to be larger than the label interval.
Summary
I'm using a
BarChart
in an app but sometimes when I re-draw it the bars width is not respected and I get inconsistent results (even though the amount of values in the X axis is always 100).This is how I want it to look always:
but sometimes it looks like this:
Does anyone know why this happens and how can I force it to always look the same?
I'm already setting a bar width value like this but it doesn't help:
Expected Behavior
The bars in the chart have the same width every time.
Device:
Additional Context
I think the issue has something to do with the range of values in the X axis, as the chart looks good when the range goes from 0 to 50 or similar, but it looks bad when the range is smaller (e.g. from 0 to 15 or 0 to 24).
The text was updated successfully, but these errors were encountered: