Search code examples
c#wpfchartslivecharts

LiveCharts - Zero shows as exponential number on Y-axis


I'm using LiveCharts on WPF to visualize log data. On the Y-axis, there are lists of doubles to be shown. The Y-axis' zero value (and in some cases, the values closest to it) are rendered as exponential numbers. In the meantime, the tooltips are showing the correct values (zeros). I've tried to pass decimals instead, but with no result. I'm using LiveCharts 0.9.7 and .NET 4.5. 0 on Y-axis is missing

I would appreciate any help :)


Solution

  • This happens because the default CartesianChart.AxisY.LabelFormatter is not smart enough.

    For now, you could easily add your own:

    myChart.AxisY.LabelFormatter = value => value.ToString("N2"); Hope it helps!