A forum dedicated to WPF version of LightningChart Ultimate.
2 posts • Page 1 of 1
I'm adding markers to my free point series. These markers have labels and symbols associated with them. The problem is that these labels overlap. How do I make it so that only one of the overlapped labels is visible?
There's no easy way to accomplish that. You can use chart.MeasureText method, pass the marker.Label.Text and marker font as parameters, and you will get the size in pixels of the text. Marker's center as pixels can be resolved with xAxis.ValueToCoord and yAxis.ValueToCoord methods. From these X and Y values you can shift it by marker.Symbol.Width and Height to know the bottom right of it where text start with default settings. Using these coordinates you should be able to make a routine that checks overlapping of the marker texts, and hides the labels if necessary.
LightningChart Support Team, PT