Skip to content

A tiny script to draw a sparkline graph in canvas. IE9+, Chrome & FF tested.

Notifications You must be signed in to change notification settings

lilithebowman/sparkline.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sparkline.js

A tiny script to draw a sparkline graph in canvas. IE9+, Chrome & FF tested.

IE8 is supported with a polyfill. ( https://code.google.com/p/explorercanvas/downloads/list )

I've added the ability to display a colour gradient as the sparkline moves left-to-right.

Usage: <canvas class="sparkline" data-sparkline="1,2,4,7,8,8,5,3,2,1"></canvas> where data-sparkline is a comma-delimited list of values.

Enjoy! Feel free to make suggestions for improvements. I have made an angular directive version which I may add to this git repository in the future.

About

A tiny script to draw a sparkline graph in canvas. IE9+, Chrome & FF tested.

Resources

Stars

Watchers

Forks

Packages