beto-rodriguez / LiveCharts2

Simple, flexible, interactive & powerful charts, maps and gauges for .Net, LiveCharts2 can now practically run everywhere Maui, Uno Platform, Blazor-wasm, WPF, WinForms, Xamarin, Avalonia, WinUI, UWP.

Home Page:https://livecharts.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If you set axis's property IsVisible=false and running a period of time, chart will popup exception.(The X axis has an excessive number of separators)

Overrainy opened this issue · comments

Describe the bug
When you set axis to hidden, then run a period of time, chart will throw exception.

To Reproduce
Steps to reproduce the behavior:

  1. Set axis property: IsVisible = false.
  2. Run a period of time. (LiveChartCore\CoreAxis\GetPossibleMaxLabelSize() => _stepCount will keep increaseing until it exceeds the upper 10000.)
  3. Chart will throw (The X/Y axis has an excessive number of separators) exception.

Root Cause
LiveChartCore\CoreAxis\GetPossibleMaxLabelSize() => _stepCount++; (Line:1050)
"_stepCount" will increases over time and can not be reset by method "Invalidate()".

Desktop (please complete the following information):

  • OS: Windows

Additional context
WPF
image

I am also facing the same problem here. Do you have a corresponding solution?

I am also facing the same problem here. Do you have a corresponding solution?

Set Axis Property: IsVisible = true and Padding = new LiveChartsCore.Drawing.Padding(0)
use property "Padding = new LiveChartsCore.Drawing.Padding(0) " to hide Axis

Padding = new LiveChartsCore.Drawing.Padding(0) does not work for me to hide labels
I use axis property Labeler as a workaround (CartesianChart with HeatSeries)
Labeler = value => ""