Image_Graph line weight question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hey guys,

I've been putting together a line graph in Image_Graph. And I can't
seem to find an answer to change the layout of few things.

Here is my graph:

1) I'm trying to bold the line.
2) I would also like to make the title bold...
3) I want to include a text inside the graph in the right corner

I would appreciate if anyone knows the answer.

Here is my code:


require_once 'Image/Graph.php';
require_once 'Image/Canvas.php';

$Canvas =& Image_Canvas::factory('png', array('width' => 172, 'height'
=> 114, 'antialias' => false));
$Graph =& Image_Graph::factory('graph', $Canvas);
//$Graph =& Image_Graph::factory('graph', array(172, 114));

$Font =& $Graph->addNew('ttf_font', 'Arial');
// set the font size to 15 pixels


         $Title = Image_Graph::factory('title', array('Dow/Gold Ratio:
Daily', 9)),
                  $Plotarea = Image_Graph::factory('plotarea'),
                  $Legend = Image_Graph::factory('title', array('Jul
08, 2008 18:16 EST', 8)),


//$Plotarea =& $Graph->addNew('plotarea', array('axis','axis'));

$Dataset =& Image_Graph::factory('dataset');
$Dataset->addPoint("06.08", 10);
$Dataset->addPoint("06.09", 3);
$Dataset->addPoint("06.11", 8);
$Dataset->addPoint("06.12", 5);
$Dataset->addPoint("06.13", 4);
$Dataset->addPoint("06.14", 3);
$Dataset->addPoint("06.17", 8);
$Dataset->addPoint("06.18", 5);
$Dataset->addPoint("06.19", 4);

$Plotarea->addNew('line_grid', false, IMAGE_GRAPH_AXIS_X);
$Plotarea->addNew('line_grid', false, IMAGE_GRAPH_AXIS_Y);

$Plot =& $Plotarea->addNew('smooth_line', array(&$Dataset));
//$Plot->setTitle('Daily Dow/Gold Ratio');

$AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X);


$Graph->done(array('filename' => 'test.png'));


Re: Image_Graph line weight question wrote:
Quoted text here. Click to load it

Image_Graph doesn't look like it's being developed any more.  The last
release was an alpha version over two years ago, there is virtual no
documentation and it has unassigned bugs almost three years ago.

I doubt anyone else is using it - and I sure wouldn't, especially for
production code.

I'd suggest you check out other packages.  jpgraph comes to mind, but
I'm sure there are others.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: Image_Graph line weight question

Quoted text here. Click to load it

Thanks a lot Jerry, I'll look into jdgraph.

Re: Image_Graph line weight question

Markus contained the following:

Quoted text here. Click to load it

Me, I'd look at jpgraph. ;-)

Geoff Berrow  0110001001101100010000000110

Site Timeline