0

I am using ZedGraphControl but cannot seem to use the full GraphPane. There are gray padding areas on each side of X-Axis. I have set the following, but it does no good.

myPane.XAxis.Scale.MinAuto = true;
myPane.XAxis.Scale.MaxAuto = true;

myPane.YAxis.Scale.MinAuto = true;
myPane.YAxis.Scale.MaxAuto = true;

myPane.Y2Axis.Scale.MinAuto = true;
myPane.Y2Axis.Scale.MaxAuto = true;
Tomcat
  • 606
  • 6
  • 18

1 Answers1

0

I'm not sure if this is what you're looking for, but maybe try setting the following properties on your ZedGraph control

  zedGraphControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((
        System.Windows.Forms.AnchorStyles.Top
        | System.Windows.Forms.AnchorStyles.Bottom) 
        | System.Windows.Forms.AnchorStyles.Left) 
        | System.Windows.Forms.AnchorStyles.Right)));
  zedGraphControl1.AutoSize = true;
  zedGraphControl1.Location = new System.Drawing.Point(0, 0);
  zedGraphControl1.Margin = new System.Windows.Forms.Padding(0);
PeskyGnat
  • 2,454
  • 19
  • 22
  • Thanks for the quick response -- I tried that too, but did not work either. I was hoping this was going to be easy, but has been a major logjam. Look here: http://www.guilhermemorais.com/blog/?tag=line-vertical I wanted my chart to look like this -- no Padding on each side of the Graph. I would like to add a picture of mine, however, I do not have authorization yet. Thanks, – user2452228 Jun 04 '13 at 18:44
  • Would you have a picture of what your graph looks like with the problematic gray areas? – PeskyGnat Jun 04 '13 at 18:51
  • I cannot upload pics, not authorized, however, look here: http://zedgraph.dariowiz.com/index3d29.html?title=Line_With_Band_Demo You can see each side of the graph has a blanked out area. The lines do not extend to the edge of the Pane – user2452228 Jun 04 '13 at 18:58
  • 1
    I see, you might need to specify zedGraphControl1.GraphPane.XAxis.Scale.Min and zedGraphControl1.GraphPane.XAxis.Scale.Max to be the min and max x values of your data set – PeskyGnat Jun 04 '13 at 19:19
  • 1
    Not the best way to run a railroad, however, this works.. except the when pressing "Default" it takes you back to the Padding. I can probably just get rid of the Padding menu item... Thanks.. double min = myPane.CurveList[0].Points[0].X; double max = myPane.CurveList[0].Points[myPane.CurveList[0].Points.Count - 1].X; myPane.XAxis.Scale.Min = min; myPane.XAxis.Scale.Max = max; – user2452228 Jun 04 '13 at 19:33
  • I was going to place a "vote up" for you, but, not authorized.. thanks. – user2452228 Jun 04 '13 at 19:40