Microcharts
Microcharts copied to clipboard
[Bug] Show bar height with colour when entry value is zero
Description When a BarChart entries values are zero, the bars show up with a height. That's confusing.
Which platform and version is this for? MacOS Catalina 10.15 Xamarin.Mac
To Reproduce Here is my simple chart entries:
var entries = new[]
{
new ChartEntry(0)
{
Color = SKColor.Parse("#8CDAB2"),
},
new ChartEntry(0)
{
Color = SKColor.Parse("#FF8B78"),
},
new ChartEntry(1)
{
Color = SKColor.Parse("#FFDF8A"),
},
new ChartEntry(0)
{
Color = SKColor.Parse("#8CDAB2"),
},
new ChartEntry(2)
{
Color = SKColor.Parse("#FF8B78"),
},
};
Expected behavior The bars should be empty when the entry value is zero.
Screenshots
Current barChart behaviour for the above entires.
You have a property MinBarHeight on the Bar chart, you can set it to 0, to match your need
@Seuleuzeuh, I couldn't find any property namely MinBarHeight in the BarChart. However, I found a property named MinValue, I tried to set this value as zero. It couldn't fix our problem, the result is the same as before.
What version of Microchart do you have ? This property is available in the latest preview package (but undocumented).
Yes by default there will always be a bar drawn of some default size for entries with values of 0. It wasn't until 1.0.0-preview1
that there is an option to set the MinBarHeight
for entries with the value 0.