Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I format the Y axis to show 2000 instead of 2 with a label of MyLabel(10^3)?

Tags:

c#

zedgraph

Using ZedGraph, how do I format the Y axis to show 2000 instead of 2 with a label of MyLabel(10^3)?

like image 409
Jim Fred Avatar asked Nov 20 '25 21:11

Jim Fred


2 Answers

Set the scale's Format Property to, say, "#" and the Mag Property to zero. For example:

 YAxis y = myPane.YAxis;
 y.Scale.Format = "#";
 y.Scale.Mag = 0;
like image 167
Jim Fred Avatar answered Nov 23 '25 11:11

Jim Fred


Set the MagAuto property to false:

zedGraph.GraphPane.YAxis.Scale.MagAuto = false;

Note that clicking on "Set Scale to Default" in the ZedGraph context menu will reset MagAuto to true. This is the source of a part of the context menu event handler:

public void ResetAutoScale( GraphPane pane, Graphics g )
{
    _scale._minAuto = true;
    _scale._maxAuto = true;
    _scale._majorStepAuto = true;
    _scale._minorStepAuto = true;
    _crossAuto = true;
    _scale._magAuto = true;
    //this.numDecAuto = true;
    _scale._formatAuto = true;
    pane.AxisChange( g );
}
like image 25
Otiel Avatar answered Nov 23 '25 12:11

Otiel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!