I add labels to the X Axis using "CustomAxisTick". The problem is that when many labels are present, the chart automatically hides some of the labels (may be to avoid overlapping issue). How do we prevent this?
How can I accomplish the following?
Show all X Axis labels by default. Find out if they overlap and show them at an angle of 45 if overlapping exists.
Disable auto placement of X axis labels
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Disable auto placement of X axis labels
set axis.DivisionReduction = False. Then they will all show.
To find out if they overlap, convert axis tick values into screen coordinates with axis.ValueToCoord. Then you get the center point coordinate of it. Then measure the label sizes with chart.MeasureText. In a for-loop, check if overlap exists.
To find out if they overlap, convert axis tick values into screen coordinates with axis.ValueToCoord. Then you get the center point coordinate of it. Then measure the label sizes with chart.MeasureText. In a for-loop, check if overlap exists.
LightningChart Support Team, PT
Re: Disable auto placement of X axis labels
axis.DivisionReduction = False is not working. Some of the labels are still hidden
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Disable auto placement of X axis labels
We will improve this in the next assembly pack. Sorry about the inconvenience.
LightningChart Support Team, PT
Re: Disable auto placement of X axis labels
Sorry, I might not have communicated properly. That property(DivisionReduction) did not have any affect on the visibility of the labels. Am I also need to do any thing else?
Basically we want to display all labels. If wrapping happens, we display at an angle of 90. We want to know solution ASAP. Thanks
Basically we want to display all labels. If wrapping happens, we display at an angle of 90. We want to know solution ASAP. Thanks
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Disable auto placement of X axis labels
With CustomAxisTicks it really doesn't seem to have an effect. I'm afraid there's no other workaround than use Annotations or markers for rendering the labels. And it becomes very complex.
LightningChart Support Team, PT