I have updated my Simple Sparklines WordPress plugin. My thanks to David Chait and Mark Wubben for anwsering my questions on the WordPress support forum. The hardwork was done for me by James Byers’ Sparkline PHP Graphing Library.
This [spark] [type line] [size auto,30] [aspect 1.5] [series 66,64,62,60,58,56,54,52,50,40,30,20,10,0][dot 7,50,5,green][/spark] and this [spark] [type bar] [size auto,4] [series -24.6,3.1,27.1,43.6,39.1][/spark] are the examples used in my original post on the plugin, but with height set to auto. If you change your text size and reload you will see the change.
I have added a [line-width number] parameter that does exactly what it says for line graphs. The line-width, like the [dot] radius is a size on the graph before re-sampling, so the actual width in pixels will be much less. Any value other than 1 (the default) tends to make non-horizontal or vertical straight lines in text sized graphs look awful. It is primarily useful for large graphs (i.e. not true sparklines), which look much better.
I have cleaned the code a bit, and there is now a function:
sparkline_insert(line | bar, height pixels | auto, width, aspect ratio, comma separated data series, [optional] feature point, line width, default height)
that can usefully be called by other plugins or from templates. The feature point parameter is a string containing a comma separated list of parameters in the same format as inserting in a post, ditto the data series. everything else apart from the chart type (line or bar) is a number (unless height is auto).
I have not done anything about implementing caching or multiple data series yet.
I would be very grateful for any feed back, both from those who use the plugin and those who see it here. In particular I need to know whether auto height works OK in IE (all versions from 5.0 upwards) and Safari. So far I know this works on Firefox, Opera and Konqueror.
To install the plugin download this, unzip and copy to your WordPress plugins directory, then activate as usual.
As a good few bloggers are likely to look at this page, I think this is a good place to mention my main sites, Investment Ideas and Money Terms in the hope that some of the users of the plugin might feel inclined to link to them. The latter may well be pretty useful to link to, for anyone writing about finance or investment. The plugin was actually developed for the latter.