Financial Sparklines

I first started thinking about sparklines (I didn't know the name then) after reading Edward Tufte's book thrilogy. At the time I was working for a financial company and we considered using them for our intranet.

Then I came across this post on ET's site and decided to write a quick Perl implementation of the idea. The code can be found at the end of this page. The use of a vector representation allows me to easily generate sparklines in different sizes. While the examples below don't qualify as sparklines, I think they show the potential information compression that this representation yields.


follow this link to view the live svg sample.

follow this link to view the live svg sample.

follow this link to view the live svg sample.

Live samples are generated using yahoo's historical data. NOTE: you may need adobe's svg plugin to view the sparkline examples.

Sparklines embedded in financial news

The text is taken from Yahoo's market overview. In the second version of it, I replaced the stock quotes for sparklines. Yearly history was used for the example, as intraday data was not available.

Close: Construction spending followed suit, coming in below expectations at 0.3%, and adding to the day's bearish tone...ISM manufacturing reported relatively in-line with expectations and did little to change market sentiment...Auto sales, released throughout the day, largely disappointed with Ford (F, -4.15%) announcing an 8% drop in U.S. sales while General Motors (GM, -2.47%) announced a drop of 15%...Two of today's most influential decliners were Cardinal Health (CAH, -24.83%) and Intel (INTC, -2.17%)...

Close: Construction spending followed suit, coming in below expectations at 0.3%, and adding to the day's bearish tone...ISM manufacturing reported relatively in-line with expectations and did little to change market sentiment...Auto sales, released throughout the day, largely disappointed with Ford announcing an 8% drop in U.S. sales while General Motors announced a drop of 15%...Two of today's most influential decliners were Cardinal Health and Intel ...


Sparklines as building blocks of an interactive trading screen.



NEW May 3, 2007: I recently tested open source svg toolkit batik, which lets you turn an svg file into a graphic file ie png, jpg etc. This can be fairly useful if you want to use my code for quick rendering and portability, yet have the ability to create graphic files as output.

July 3, 2004: The first version of the perl script can be found here. I just made some changes, trying to keep the code output easier to scale among other things. there still are some scaling issues.

Shameless self-promotion: I can customize a sparkline solution (or similar ideas) if needed. Contact me using the address below.