Hi
I will add second Y-axis ( to the right) to XY chart . if I use this
AxisY axisY = new AxisY(_chart.ViewXY); ;
axisY.SetRange(0, 20);
axisY.LabelsNumberFormat = "0";
axisY.AutoFormatLabels = false;
_chart.ViewXY.AxisLayout.YAxisAutoPlacement = YAxisAutoPlacement.AllLeft;
AxisY axisY2 = new AxisY(_chart.ViewXY);
axisY2.SetRange(0, 50);
axisY2.LabelsNumberFormat = "0";
axisY2.AutoFormatLabels = false;
_chart.ViewXY.AxisLayout.YAxisAutoPlacement = YAxisAutoPlacement.LeftThenRight;
I can only see first axis (the left one)
What do I do wrong?
Two Y axis
Moderator: Queue Moderators
-
- Posts: 558
- Joined: Mon Mar 14, 2016 9:22 am
Re: Two Y axis
Didn't you forget to add Axis to the collection/list
If you using non-bindable WPF edition or WinForms edition of LightningChart control, then there is always 1 pair of X- and Y-axis. Either you edit 1st YAxis and add 2nd YAxis, or you remove all old items from collection. For example,
Code: Select all
chart.ViewXY.YAxes.Add(yAxis);
Code: Select all
while (chart.ViewXY.YAxes.Count > 0)
chart.ViewXY.YAxes.RemoveAndDispose<AxisY>(0);