Should I bring all my shoes and glasses?

//Using Javascript to Graph Sparklines

General | | 7. April, 2009

Graphing sparklines may appeal to those who have read the Edward Tufte books (I’m looking at you AJR) on the visual representation of data. On his blog he talks about sparklines here.  If you consider yourself part of this group there is a pre-written Javascript sparkline generator you may be interested in by the name of jquery sparklines.

To set this up you’ll need: 1. Some data to graph, 2. A webserver where you can host the js and html files, 3. jquery and jquery.sparklines, 4. Some basic Javascript skills…maybe PHP or Phython if you plan on generating dynamic content for the lines.

Disclaimer: I used the graphs and data directly from the sparklines site because I’m too lazy to create my own numbers.  Note that I’m limited in this post as I can’t use var or span id tag in a post, so these example all have inline static data.  For an example of one using dynamic data see this page.

Example Sparklines:

Inline Sparkline: 1,4,4,7,5,9,10
Bar charts 10,8,9,3,5,8,5 negative values: -3,1,2,0,3,-1
Composite inline 8,4,0,0,0,0,1,4,4,10,10,10,10,0,0,0,4,6,5,9,10
Dow 90,10,25,150,180
Chances that Art will think sparklines bring any value -1,-3,-5,-7,-9,-11,-25

Comments

  • aj says:

    check out google’s new use of sparklines – http://www.google.com/finance?client=ob&q=NYSE:RHI

    sweet

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    Next | Previous
    Theme made by Igor T. | Powered by WordPress | Log in | | RSS | Back to Top