Disable auto placement of X axis labels

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
srinin2k
Posts: 25
Joined: Thu Jun 18, 2015 9:22 pm

Disable auto placement of X axis labels

Post by srinin2k » Tue Feb 02, 2016 10:57 pm

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.

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Disable auto placement of X axis labels

Post by ArctionPasi » Wed Feb 03, 2016 6:24 am

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.
LightningChart Support Team, PT

srinin2k
Posts: 25
Joined: Thu Jun 18, 2015 9:22 pm

Re: Disable auto placement of X axis labels

Post by srinin2k » Wed Feb 03, 2016 8:15 pm

axis.DivisionReduction = False is not working. Some of the labels are still hidden

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Disable auto placement of X axis labels

Post by ArctionPasi » Thu Feb 04, 2016 4:20 pm

We will improve this in the next assembly pack. Sorry about the inconvenience.
LightningChart Support Team, PT

srinin2k
Posts: 25
Joined: Thu Jun 18, 2015 9:22 pm

Re: Disable auto placement of X axis labels

Post by srinin2k » Thu Feb 04, 2016 7:57 pm

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

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Disable auto placement of X axis labels

Post by ArctionPasi » Thu Feb 04, 2016 8:47 pm

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

Post Reply