Theo
Theo

Reputation: 11

zedgraph custom auto scale - but with minimum (of Min), and minimum of Max)

I use Zedgraph in order to plot, and I use AxisChange(); in order to auto-scale my graph.

My problem : I'd like to always see 0 to 10 on Y scale even After I go down or UP (auto-scale) , but I'd like always keep this value showed.

Here is an example of what I have now :

https://i.sstatic.net/sIqZK.png

Here a screen shot of what I'd like to change (I want always see 0 to 10) even I have no value...

https://i.sstatic.net/I3iQF.png

EDIT

Sorry I wasn't clear enough... My goal is to have a graph that display AT least 0 to 10 in the Yaxis (always). but if the values goes down (0 to -100) or up (10 to 100), the graph auto scale the Y axis and show more values. For example even I've the value oscillating around "100" during 2 mins, I want to see my scale 0 to 110.

I don't know if it's possible or not?

In fact as soon as I put :

myPane.YAxis.Scale.Min = 0;
myPane.YAxis.Scale.Max = 10;

The auto scale stop working ...

Thanks for your help

Upvotes: 1

Views: 6508

Answers (1)

SanVEE
SanVEE

Reputation: 2070

You can manually set 'Y' axis as follows,

        myPane.YAxis.Scale.Min = 0;
        myPane.YAxis.Scale.Max = 10;
        myPane.AxisChange();
        zedGraphControl1.Invalidate();

and if you want to reverse the scale set the 'IsReverse' property to 'True'

        myPane.YAxis.Scale.IsReverse = true;

Upvotes: 4

Related Questions