2

My code generates graph from SQL and I am using phpgraphlib for generating the graph. Is there a way to save this graph as a image to a specific location on a server?

Thanks in advance.

Hamish
  • 22,860
  • 8
  • 53
  • 67
yokoyoko
  • 265
  • 3
  • 11

1 Answers1

4

I've never used it, but looking at the documentation:

Constructor

PHPGraphLib ( int $width, int $height, [string $filename] )

...

If you specify the optional filename argument, PHPGraphLib will not display to the screen, but instead create a .png file in the same directory as the script where PHPGraphLib is being called.

So, create your graph with the relevant $filename in the constructor and it should save there when you call ->createGraph().

Hamish
  • 22,860
  • 8
  • 53
  • 67