0

I am trying to saveAs the zedgraph diagram that my program creates. The problem is that when i use that code it saves the image but only the labels on top of the bars appear...no bars are displayed.

 chart1.SaveAs();

Am i missing something?

The code that creates the diagram:

GraphPane myPane = chart1.GraphPane;
        myPane.XAxis.Scale.Format = "F0";
        //create the bars
        BarItem myCurve = myPane.AddBar("Width", pointPairListWidth, Color.Black);
        myCurve.Bar.Fill.Type = FillType.Solid;
        BarItem myCurve2 = myPane.AddBar("Height", pointPairListHeight, Color.Gray);
        BarItem.CreateBarLabels(myPane, false, "f0");
        chart1.AxisChange();
        chart1.Invalidate();
        chart1.Refresh();

ANSWER:

 chart1.GraphPane.GetImage().Save("pic.jpg");
Silvia Stoyanova
  • 271
  • 2
  • 6
  • 20

1 Answers1

0

you could try zedGraphControl.MasterPane.GetImage().Save("test.bmp")

Edit: was a long time ago since I've used zedGraph, but you are adding those bars to your myPane-object. So can you do myPane.SaveAs()?

sschrass
  • 7,014
  • 6
  • 43
  • 62