Page 1 of 1

Graph area completely cleared with too many AxisY

Posted: Fri Apr 30, 2021 11:57 am
by Energetic
Hello,
In our application users can add multiple additional AxisY to a ViewXY in a chart, however if the axes are too many compared to the size of the chart, the graph area gets completely cleared: one can see neither any axes, nor plots. Is there a way to detect with some event when this condition occures, so that I can at least give a message to the user to disable some of the axes. (It can be particularly confusing when the users loads multiple new data sources at once and cannot see that the area is gradually getting smaller before everything disaperas). I just updated to lightningchat 10.0.1.

Re: Graph area completely cleared with too many AxisY

Posted: Fri Apr 30, 2021 1:50 pm
by ArctionKestutis
In the next release it will be such event/message, which informs about problem. Even more - something still should be rendered automatically, even if there is not enough space to fit it all.
As for now, you should check Chart size and compare to required size. Main reason for failure is too big gap between segments. Default value for chart.ViewXY.AxisLayout.SegmentsGap property is 20 [px]. If you set it to 0, then chart should draw even if segment size just 1 pixel.
You could get Chart size, after it was rendered. Depending on platform used (WPF, WinForms, headless mode) it may different event. _chart.AfterRendering is most general approach. But in many cases it is enough to use Chart.Loaded or Chart.SizeChanged.