LiveCharts2
LiveCharts2 copied to clipboard
IsVisible = false Axes will inevitably ThrowInfiniteSeparators()
With the rc versions of the library, the new ThrowInfiniteSeparators is being thrown for even simple plots if axes are hidden. This is because _stepCount is modified in Invalidate, but hidden axes never call that, despite having GetBounds called (and thus incrementing through each call to GetPossibleMaxLabelSize)
I have a setup (using WPF hosted WinForms due to https://github.com/beto-rodriguez/LiveCharts2/issues/1237) with a main chart that can zoom and an overview chart (can't zoom, hidden axes), fairly similar to your own example.
I downloaded the source and modified it to print out the current _stepCount at the start of each call that modifies it, and I get the following (stopped when it hit the 10000 and blew up):
GetPossibleMaxLabelSize - 9700 GetPossibleMaxLabelSize - 9970 GetPossibleMaxLabelSize - 9725 GetPossibleMaxLabelSize - 9996
If I make the overview axes visible, Invalidate is called, which clears the count. I think this should be replicable by hiding the axes of any live data chart, but if you're having trouble I can try to replicate with one of the built-in samples.
I temporarily fixed this by resetting the _stepCount in GetPossibleMaxLabelSize, which is obviously a no-go and defeats the whole point of the check. However, I believe this is the first stack frame the code is entering the Axis class from the GetTick() that is being called. I'm unsure what the correct fix is here, otherwise I would have just submitted a PR.
Any thing new on this? I am have the same issue.
I'm currently working around it by building the library myself with the following change:
It isn't perfect and defeats the point of the check, but it allows me to proceed for now.
I'm currently working around it by building the library myself with the following change:
It isn't perfect and defeats the point of the check, but it allows me to proceed for now.
Do you have some solution? I think I have the same or similar problem too: https://github.com/beto-rodriguez/LiveCharts2/issues/1464
I'm currently working around it by building the library myself with the following change:
It isn't perfect and defeats the point of the check, but it allows me to proceed for now.
Do you have some solution? I think I have the same or similar problem too: #1464
Do you found solution?
No, unfortunately ;(
Only "solution" I have is the change described. By injecting that line into CoreAxis.cs, the count is reset and it avoids the kill condition. Not a perfect solution, but it works around the problem for now.
that means, I should compile the solution inside if projekt and do not use a package... Ok, hope it will be fixed in the release
I get this error when I try to do the following -> "Add a secondary axis, remove it and add it again"
This fixed it for me: https://github.com/beto-rodriguez/LiveCharts2/issues/1495#issuecomment-2088313998
Hopefully there is soon a new release that ships a fix.