Custom Y-Axis arrangement

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
Igor
Posts: 67
Joined: Mon Sep 28, 2015 1:14 pm

Custom Y-Axis arrangement

Post by Igor » Wed Apr 27, 2016 10:29 am

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
LeftThenRight.png
LeftThenRight.png (53.67 KiB) Viewed 12244 times
# wished behaviour, were I could set the location of the axis via property ("yAxis2.Location = Location.Left;" or something like this )
3AxisLeft_1AxisRight.png
3AxisLeft_1AxisRight.png (53.58 KiB) Viewed 12244 times
I haven't found anything about this in the documentation nor in the demo application.
Thank you

Igor

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

Re: Custom Y-Axis arrangement

Post by ArctionPasi » Wed Apr 27, 2016 3:13 pm

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

lokesh
Posts: 45
Joined: Tue Feb 14, 2017 8:48 am

Re: Custom Y-Axis arrangement

Post by lokesh » Wed Feb 22, 2017 11:20 pm

Hi,
I was following this thread and ended up with this:
yAxisScaling.png
yAxisScaling.png (70.33 KiB) Viewed 11377 times
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

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

Re: Custom Y-Axis arrangement

Post by ArctionPasi » Thu Feb 23, 2017 6:28 am

Hi Lokesh,

please set ViewXY.AxisLayout.AutoAdjustMargins = false, and set margins rectangle manually in ViewXY.Margins.
LightningChart Support Team, PT

Post Reply