Hi Filip,
You can use only custom axes - the only restriction is that you cannot delete the standard axes.
The following code snippet shows how to create three line series, each scaling on a custom Y axis:
private void Form1_Load(object sender, EventArgs e)
{
NChart chart = nChartControl1.Charts[0];
NLineSeries line1 = CreateLineSeries(Color.Red);
chart.Series.Add(line1);
NLineSeries line2 = CreateLineSeries(Color.Green);
chart.Series.Add(line2);
NLineSeries line3 = CreateLineSeries(Color.Blue);
chart.Series.Add(line3);
chart.Axis(StandardAxis.PrimaryY).Visible = false;
NAxis customAxis1 = CreateCustomAxis(chart, Color.Red);
line1.DisplayOnAxis((int)StandardAxis.PrimaryY, false);
line1.DisplayOnAxis(customAxis1.AxisId, true);
NAxis customAxis2 = CreateCustomAxis(chart, Color.Green);
line2.DisplayOnAxis((int)StandardAxis.PrimaryY, false);
line2.DisplayOnAxis(customAxis2.AxisId, true);
NAxis customAxis3 = CreateCustomAxis(chart, Color.Blue);
line3.DisplayOnAxis((int)StandardAxis.PrimaryY, false);
line3.DisplayOnAxis(customAxis3.AxisId, true);
}
private NAxis CreateCustomAxis(NChart chart, Color color)
{
NAxis customAxis = ((NCartesianAxisCollection)chart.Axes).AddCustomAxis(AxisOrientation.Vertical, AxisDockZone.FrontLeft);
// modify the anchor so that it creates a new zone levek
customAxis.Anchor = new NDockAxisAnchor(AxisDockZone.FrontLeft, true);
NLinearScaleConfigurator scale = customAxis.ScaleConfigurator as NLinearScaleConfigurator;
scale.RulerStyle.BorderStyle.Color = color;
return customAxis;
}
Random rand = new Random();
private NLineSeries CreateLineSeries(Color color)
{
NLineSeries line = new NLineSeries();
line.DataLabelStyle.Visible = false;
line.BorderStyle.Color = color;
for (int i = 0; i < 10; i++)
{
line.Values.Add(rand.Next(100));
}
return line;
}
Probably in your code you have to touch the axis anchor a bit (so that it does not creaete a separate scale level - check out Axes\General\Ruler Size example).
Hope this helps - let us know if you meet any problems.
Best Regards,
Nevron Support Team