Blog


Sparklines with Javascript and Canvas

About a month ago, when the new Firefox beta was released, I decided to play around with the brand-spanking new Canvas element, which is going into HTML 5. Currently Mozilla, Safari, and Opera 9 all support it - which is a good sign. Essentially, this element allows you to do 2D graphics (drawing lines, rotating images, etc.) - which is great for doing some more 'intense' web applications.

The first thing I decided to implement was a simple Javascript Sparklines library. All it does is run through your HTML, look for your embedded Sparklines, and replace them with pretty little charts - it even scales them appropriately. It's completely unobtrusive so a simple call in the header of your HTML file should be sufficient to run it. For more information, and a snazzy demo, visit the project page.

Tags: canvas, sparklines, programming, javascript, firefox

Current Projects

jQuery JavaScript Library

jQuery

Comprehensive DOM, Event, Animation, and Ajax JavaScript Library.

Recent Projects

Pro JavaScript Techniques

JavaScript Book

The best techniques for professional JavaScript. Published by Apress.


Hosting provided by the cool dudes at Engine Yard.