LabelsPosition for Y-axes?

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
ShawnCG
Posts: 57
Joined: Tue Oct 15, 2013 8:31 pm

LabelsPosition for Y-axes?

Post by ShawnCG » Sat Jan 04, 2014 1:40 am

Is there any way to specify the label position for Y-axes in ViewXY plots? I am trying to have a Y-axis on the left such that the major tick marks are pointing to the inside of the plot but the labels are on the outside.

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

Re: LabelsPosition for Y-axes?

Post by ArctionPasi » Sat Jan 04, 2014 10:16 am

axis.MajorDivTickStyle.Alignment adjusts both the labels and the ticks to the same direction. With one axis, it's not possible to set them in opposite directions.

But two workarounds come into my fuzzy mind right now:

1) Utilizing minor div ticks.
yAxis.MajorDivTickStyle.Alignment = Near;
yAxis.MajorDivTickStyle.Visible = false;
yAxis.MinorDivTickStyle.Alignment = Far;
yAxis.MinorDivTickStyle.LineLength = 8;
yAxis.MinorDivCount =1;
Axis labels aligned in opposite direction than ticks
Axis labels aligned in opposite direction than ticks
AxisTicksAlignmentInOppositeDirections.jpg (2.84 KiB) Viewed 7358 times



2) Utilizing two Y axes in the same Position (yAxis1.Position == yAxis2.Position). One to show the labels, one to show the MajorDivTicks. Set another axis passive to mouse, by setting MouseInteraction = false. In RangeChanged event handler of mouse-interactive axis, set other axis range to same. This approach needs ViewXY.YAxisLayout to be set as 'Layered'. Minor divs and grid can be shown in this approach.


Something like this 8-)
LightningChart Support Team, PT

ShawnCG
Posts: 57
Joined: Tue Oct 15, 2013 8:31 pm

Re: LabelsPosition for Y-axes?

Post by ShawnCG » Mon Jan 06, 2014 9:40 pm

Your first work-around suggestions is good for my situation since I don't need both major and minor ticks displayed.

Post Reply