kevin628
kevin628

Reputation: 3526

Add text to ZedGraph outside the graph area

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

Upvotes: 3

Views: 2974

Answers (1)

SanVEE
SanVEE

Reputation: 2060

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....:)

Upvotes: 4

Related Questions