phpjpgraph

Jpgraph position text at certain x-value position


I'm using JPGraph with a simple Line plot.

It's possible to create a text or image and position it vertically and horizontally centered on a point of my line?

Something like:

$txt = new Text("hello");
$txt->SetPosition????("center",$p1->$index,$shift_x,$shift_y);

Solution

  • it is possible to position the text on a specific point in the graph area by

    $txt->SetScalePos(x, y);
    

    where x and y are the coordinations on the X and Y axis.