Código:
pero no se si se puede trabajar igual que una url para obtener datos mediante $_GET/$_POST.<img>
Aquí les dejo lo que dice en la documentación:
Cita:
Alguien ha probado a hacer algo así??? 4.4 The basic principle of JpGraph and the creation of images
The common pattern for creating graphs is
1. Create a script that constructs the image, type, colors size and so on.
2. A wrapper script which contains one or more <IMG> tags to position the graphs on the proper HTML page.
Of course it is of perfectly possible to call the image script directly in the browser to just display the generated image in the browser.
You should remember that it is also possible to pass arguments to the image script via the normal HTTP GET/POST arguments. For example
<img src ="showgraph.php?a=1&b=2" >
This could for example be used to control the appearance of the image or perhaps send data to the image which will be displayed. Note that this is probably not the best way to send large amount of data to plot. Instead the only practical way, for large data sizes, is to get all the data in the image script, perhaps from a DB. Another alternative for large amount of data to be sent to the image script is by creating a POST request to the image script.
The common pattern for creating graphs is
1. Create a script that constructs the image, type, colors size and so on.
2. A wrapper script which contains one or more <IMG> tags to position the graphs on the proper HTML page.
Of course it is of perfectly possible to call the image script directly in the browser to just display the generated image in the browser.
You should remember that it is also possible to pass arguments to the image script via the normal HTTP GET/POST arguments. For example
<img src ="showgraph.php?a=1&b=2" >
This could for example be used to control the appearance of the image or perhaps send data to the image which will be displayed. Note that this is probably not the best way to send large amount of data to plot. Instead the only practical way, for large data sizes, is to get all the data in the image script, perhaps from a DB. Another alternative for large amount of data to be sent to the image script is by creating a POST request to the image script.