LabelsPosition for Y-axes?
Moderator: Queue Moderators
LabelsPosition for Y-axes?
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.
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: LabelsPosition for Y-axes?
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;
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
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;
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
LightningChart Support Team, PT
Re: LabelsPosition for Y-axes?
Your first work-around suggestions is good for my situation since I don't need both major and minor ticks displayed.