3

Is it possible to add text to a ZedGraph that sits outside the graph area? For example, underneath the X-axis near the "Distance (ft)" label in the picture below.

I've tried adding a child Label control to the ZedGraph, and I even tried drawing on the Graphics object from the ZedGraph. Neither solution worked, though.

EDIT (6 June, 2014): It appears imgur trashed my original picture. Apologies everyone.

enter image description here

kevin628
  • 3,458
  • 3
  • 30
  • 44

1 Answers1

4

I guess TextObj would be a good solution.

Here's a simple example :

private void Form1_Load(object sender, EventArgs e)
{
    GraphPane pane = zedGraphControl1.GraphPane;
    pane.Chart.Rect = new RectangleF(10, 10, 500, 200);
    TextObj testObj = new TextObj("X Axis Additional Text", 0.6, -0.3);
    pane.GraphObjList.Add(testObj);
    zedGraphControl1.Refresh();
 }

enter image description here

Hope it helps....:)

SanVEE
  • 2,009
  • 5
  • 34
  • 55