AlohaKit.Controls
AlohaKit.Controls copied to clipboard
BarChartView if all chartitem.value = 0 will crash
like sample set all chartitem.value = 0 , app will crash ObservableCollection<ChartItem> _chartCollection = new ObservableCollection<ChartItem>() { {new ChartItem(){ Value= 0, Label = "a"}}, {new ChartItem(){ Value= 0, Label = "b"} }, {new ChartItem(){ Value= 0, Label = "c"} }, {new ChartItem(){ Value= 0, Label = "d"} }, {new ChartItem(){ Value= 0, Label = "e"} } };
Ok I had modified it.
protected virtual void DrawHorizontalStepLines
int maxEntryIndex = points.ToList().IndexOf(maxPoint);
if(maxEntryIndex == -1) maxEntryIndex = 0; thist line is added
var maxEntry = Entries.ElementAt(maxEntryIndex).Value;