August 2006

A Sidebar Widget for SparkStats

Wordpress Sidebar widgets are cool but can have an impact on some plugins. Sparkstats for example is a very nice little plugin that I like to use. But it no longer works when you use the new sidebar widgets.

In trying to fix Sparkstats I first used one of the built-in text widget and pointed an IMG link directly to the sparkstats .png file.

eg:

<img alt="SparkStats" src="/wp-content/plugins/sparkstats/curstats.png" />

This is a simple fix that “just works”. It also shows how useful the text and rss widgets can be.

Another fix was to play with Stewart Ugelow’s “theme widgets“. This is kind of a plugin on a plugin but was a good intro to the whole custom widget world. So following his notes I created a file called “widget-sparks” using the sparkStats_imgURI() as a variable. This was a little cleaner but I’m not sure if I will keep on using the theme widgets long term.

It was late but why not go the whole way says I. Well thanks to Kaf Under and his example widget I was inspired and able to make my very own sparkstat widget. A few hacks later and a new widget is born.

You can grab a (txt) copy of my beta version here.
Note: You will need the sparkstats plugin and the sidebar widgets plugin. Then rename the sparks file with a php extension and put it in the plugins/widgets directory.

Code
WordPress

Comments (1)

Permalink

Excel and Lotus Notes in-Cell graphs

From a post at Lifehacker from a post at juiceanalytics showed a cool way to put mini graphs in a cell next to the data in Excel. This is not new but a good reminder of what can be done with old fashion ASCII art.

Reminds me to go back and look at the work of Edward Tufte and his beautiful displays of information - I have used sparklines and other techniques from his books.

Also worth pointing out that this also works nicely in lotus notes and domino views using basically the same code and exactly the same technique.

Graph in a view

The formulas in Notes for the above cols are:

@Repeat(ā€lā€;NumberField) for a Number Field
and
@Repeat(ā€lā€;@TextToNumber(TextField)) if a text Field

then you can format the col as you need

Domino
Lifehacker
Surveys

Comments (0)

Permalink