|
Cookbook /
GoalMeterSummary: Create thermometers or columns showing goals and current values
Version: 2007-04-25
Prerequisites: pmwiki 2, GD library
Status: stable
Maintainer:
Download: goalmeter.phpΔ
Questions answered by this recipeI like to add a fundraising thermometer on a page.
DescriptionShow a thermometer or column with goal and current values. Install goalmeter.phpΔ the usual way by copying file to cookbook/ direcory and adding to a local configuration file: include_once("$FarmD/cookbook/goalmeter.php");
Then use in a page the markup To customise the image you can add lots of parameters. You can have multiple goalmeters on one page, by adding a unique Default settings:
'id' => '0', # img id
'current' => '0', # current value
'goal' => '100', # goal value
'max' => '', # max value as alternative to goal, goal will not be displayed
'height' => '360', # outer height
'width' => '', # outer width, default automatic calculation
'bar' => '3', # bar thickness 1 ... 5
'font' => '4', # font size 1 ... 5
'bg' => 'ffffffff',# background color (transparent)
'fill' => 'FF0000', # main fill and border color
'topfill' => 'FFFFCC', # top fill color
'bulbfill'=> '', # bulb fill color (defaults to main fill color)
'scale' => '666666', # scale color
'value' => '000000', # value text color
'percent' => 'FFFFFF', # percent text color
'border' => '', # outer border color
'nobulb' => '', # set to 1 for column only display
'noscale' => '', # set to 1 for no scale display
'padding' => '8', # img padding
'rpad' => '40', # right hand extra padding
The resulting image(s) are stored in a cache directory with unique filenames according to their You can see a demo here: http://softflow.co.uk/design/Test/GoalMeter NotesThe server needs to have the php GD library installed, which supports image functions. See www.php.net/gd Release Notes
CommentsSimon Brown 16/Nov/06 I added this recipe but I get an error message; Fatal error: Call to undefined function: imagefontwidth() in c:\inetpub\wwwroot\pmwiki\cookbook\goalmeter.php on line 66 When I try to preview or save. I am using Wiki 2.2.0.beta2 with the triad skin Any ideas? I think your server does not have the GD graphic library installed. Probably not part of your local default php installation. See www.php.net/gd. ~HansB See Also
Contributors |