Hi Pasi,
is it possible to change the location of a specific y-axis and not use the "YAxisAutoPlacement" (LeftThenRight, AllLeft...)?
So I could place for example three axes on the left side and one on the right side.
# Auto placement left then right
# wished behaviour, were I could set the location of the axis via property ("yAxis2.Location = Location.Left;" or something like this )
I haven't found anything about this in the documentation nor in the demo application.
Thank you
Igor
Custom Y-Axis arrangement
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Custom Y-Axis arrangement
That's possible by disabling Y axes auto placement, and setting Position property for each Y axis, and aligning the ticks.
- Set ViewXY.AxisLayout.YAxesAutoPlacement = Off
- Set yAxis.Position for each Y axis. Position is defined in percents of graph width. 0 = Left margin, 100 = right margin. It can be set negative too.
- Then you'll need to align Y axis ticks and labels. For those that you want to right-align the ticks, set yAxis.MajorDivTickStyle.Alignment = Far. Same for MinorDivTickStyle.
That's about it
- Set ViewXY.AxisLayout.YAxesAutoPlacement = Off
- Set yAxis.Position for each Y axis. Position is defined in percents of graph width. 0 = Left margin, 100 = right margin. It can be set negative too.
- Then you'll need to align Y axis ticks and labels. For those that you want to right-align the ticks, set yAxis.MajorDivTickStyle.Alignment = Far. Same for MinorDivTickStyle.
That's about it
LightningChart Support Team, PT
Re: Custom Y-Axis arrangement
Hi,
I was following this thread and ended up with this:
I was able to set the y-axes, but the view got cropped somehow. Could you please help me set the view properly inside the chart? I have been playing with it for some time without any luck.
Thanks in advance.
Regards,
Lokesh
I was following this thread and ended up with this:
I was able to set the y-axes, but the view got cropped somehow. Could you please help me set the view properly inside the chart? I have been playing with it for some time without any luck.
Thanks in advance.
Regards,
Lokesh
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Custom Y-Axis arrangement
Hi Lokesh,
please set ViewXY.AxisLayout.AutoAdjustMargins = false, and set margins rectangle manually in ViewXY.Margins.
please set ViewXY.AxisLayout.AutoAdjustMargins = false, and set margins rectangle manually in ViewXY.Margins.
LightningChart Support Team, PT