Search code examples
c#chartsdrawingzedgraph

How I can hide "0" labels on Y and X axis in ZedGraph?


Here's what I am talking about:

The image

Is there a way to hide that "0" labels on Y and X axis?

I'm using ZedGraph.


Solution

  • Try setting this option in your zedGraphControl:

    zgcGraph.GraphPane.XAxis.Scale.IsSkipCrossLabel = true;
    zgcGraph.GraphPane.YAxis.Scale.IsSkipCrossLabel = true; 
    

    This should be responsible for whether you see a label at the "cross", in your case - the "0" label. Make sure you refresh the control after setting this, sometimes ZedGraph is picky about actually displaying what you set it to.

    Optionally, to remove ALL labels, try

    zgcGraph.GraphPane.XAxis.Scale.IsVisible = false;
    zgcGraph.GraphPane.YAxis.Scale.IsVisible = false;