[thelist] Sparklines implementation

Luther, Ron ron.luther at hp.com
Wed Oct 27 12:55:59 CDT 2004

Courtenay noted:

>>I'm working on a cross-platform implementation, i.e. javascript, so
>>that the ASP weenies can use it too (ha ha, no offense!)

Hi Courtenay,

Javascript??? Could you explain that a little further? I must be missing 
something here.

As a long-time chart/graph/stats/reporting person I found the Tufte 
chapter on sparklines interesting. (Okay, I find a _lot_ of his work 
interesting.)  ;-)   

{Thanks, BTW, to whoever put up the initial link!}

My first thought, (like partyarmy), was that a number of these wouldn't 
be too difficult to implement in PHP using the GD library and displayed 
as a graphic. (Cross browser if not cross platform.) 

The binomial (win/loss, over/under, heads/tails) example in particular 
seemed like a simple place to start.

[Since I'd probably be pulling the underlying data out of a db anyway, 
a server-side approach feels more natural to me than trying to create 
these client-side.]

After some more thought, I'm thinking this may be as close as we can easily 
get with today's tools.

The problem with the above approach is that it doesn't seem to capture 
one of the essential characteristics of a sparkline ... the ability to 
use them "as a word". 

That would seem to imply the ability to use them 'in-line', flowing text 
around them, and having them keep their same relative position (and 
relative importance) within the text through 'liquid' resizing movements. 
Whew! Tall order!

You might be able to handle some of that in JS, but I think it would be 
pretty tough - if you had more than one sparkline, or you wanted folks to 
be able to edit the other text again, or if users turned off JS, or if 
users had their own style sheet settings and increased or decreased font 
size ... 

I think it would almost be easier to define and embed a 'sparkline' font 
into your page. (And I have seen some excellent examples of folks using 
this type of approach to render things like those 'precipitation by State' 
charts where different colors are assigned to different levels of rain. 
The -really cool- part was that by using a font for the individual States 
they were able to rescale and keep relative position very easily. {You 
don't suddenly wind up with Vermont on the west coast for example.} 
I talked to the guy who did the work earlier this year ... he's now 
working on EU country fonts and US counties by State fonts. That's a lot 
of work!) 

Unfortunately, I don't have that kind of patience!  ;-)

>>Also, its not just about graphs.. hmm...

<scratches head /> Huh? I thought we were talking about Tufte!

Good Luck!


More information about the thelist mailing list