3

How do I remove the gray border of the ZedGraph control?

Just the graph should be in the form, without the gray border, label, and an title.

I tried to solve the problem with

_zgc.MasterPane.Border.Width = 0;
_zgc.MasterPane.Border.IsVisible = false;

but for now without success.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user1579585
  • 55
  • 1
  • 6
  • user1579585, I have tried to use the latest version of ZedGraph in a new Visual Studio project, and I don't see any gray borders. Can you add a screenshot of the problem? – Peter Mortensen Sep 03 '12 at 00:05

3 Answers3

2

The solution is:

GraphPane _gp = _zgc.GraphPane;
_gp.Margin.All = 0;
_gp.Legend.IsVisible = false;
_gp.Title.IsVisible = false;
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

The problem is your are using the Masterpane instead of the Graphpane.

_zgc.GraphPane.Border.IsVisible = false;
_zgc.GraphPane.Legend.IsVisible = false;
_zgp.GraphPane.Title.IsVisible = false;
Anthony Phan
  • 353
  • 3
  • 13
0

If you want to hide everything but the chart content:

zedGraph.GraphPane.Title.IsVisible = false;
zedGraph.GraphPane.XAxis.IsVisible = false;
zedGraph.GraphPane.YAxis.IsVisible = false;
zedGraph.GraphPane.Border.IsVisible = false;
zedGraph.GraphPane.Chart.Border.IsVisible = false;

You can also remove the gap between chart pane and control borders:

zedGraph.GraphPane.Margin.All = -1;
saastn
  • 5,717
  • 8
  • 47
  • 78