Hide Overlapped SeriesEventMarker Labels
Moderator: Queue Moderators
Hide Overlapped SeriesEventMarker Labels
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?
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Hide Overlapped SeriesEventMarker Labels
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