ZedGraph Lock Axis

I used ZedGraph to print data from multiple sources with one click. I need the Y axis to always have the same maximum and minimum values ​​for each graph. I need this to see changes between datasets when I look at them. In my case, it is impractical to compile data from several sources on the same chart.

I tried to set the axis properties as follows:

myPane.Y2Axis.Scale.Max = 40; myPane.Y2Axis.Scale.MaxAuto = false; myPane.Y2Axis.Scale.Min = -40; myPane.Y2Axis.Scale.MinAuto = false; 

I can still see that the axes are automatically scaled. Please give me a hint if this is possible or not. I probably only miss a small thing ...

(by the way: I hope someone chooses this project, that's great!)

+4
source share
2 answers

Well, it’s solved like this:

  zGC.AxisChange(); zGC.RestoreScale(myPane); zGC.ZoomOut(myPane); 

ZoomOut () has been added since I realized that RestoreScale () is actually always autozone ...

-rb

+1
source

Is your intention to synchronize the scales of all the panels that you use? If so, have you seen this tutorial ?

Secondly, Y2Axis not displayed by default. ZG uses the first Y axis ( YAxis ) by default. Did you Y2Axis manually?

0
source

Source: https://habr.com/ru/post/1307525/


All Articles