Summary: Generate on-the-fly graphics within a PmWiki page using a PHP script.
Maintainer: David Sovinski (Caspian)
Category: Images

Questions answered by this recipe

Generate on-the-fly graphics within a pmwiki page using a PHP script.


(:Display PHP built graphics on the fly using PHP Image functions:)


One of the organizations I work with wanted to display a Thermometer / Goal Graph that would indicate the current status of our fundraiser graphically.

I found a PHP Thermometer / Goal Graph at but didn't know how to call it from within pmWiki. So I posted to the pmwiki-users group and Wendell Brown answered. He let me know he was the writer of the program. He was also able show me how to implement it in pmwiki. Thanks Wendell!

From that page I copied everything between
-------- Script Starts Here -------
-------- Script Ends Here -------
and saved it to a file called thermometer.php.

I uploaded this file to the pmwiki/scripts directory and called it from within the body of a pmwiki page as follows:

Using this style of programming we were able to instantly change the parameters of the Thermometer / Goal Graph from within the pmwiki page and display the new results.

You can look at to see how you can wrap text around images

Later, I modified Wendell's program to add a "blow off the top" feature so when the goal was reached or exceeded there would be a mini-explosion of the Thermometer / Goal Graph.

You can see the code to make these images here: thermometer.phpΔ

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".


See Also

  • Goal Meter Based on this script, developed into standard recipe, for highly customisable goal thermometers