开发者

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

Using ZedGraph, ho开发者_运维知识库w do I format the Y axis to show 2000 instead of 2 with a label of MyLabel(10^3)?


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;


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 );
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜