My take on jQuery charts
by Pascal Opitz on February 28 2009, 20:24
A while back I did a couple of posts touching the subject HTML 5 and the canvas tag. Of course I have been tinkering around with chart drawing APIs and so on, and couldn't help to write a little script myself.
I started out with pie charts, and essentially did a mashup between Jon Combes approach and Advanced Canvas Based Pie Chart by Matthew Knott, then wrapped a JQuery plugin around it.
Later I added some sidebar charts, which were much simpler to do and don't require to understand the fact that javascript does trigonometric functions in radians rather than degrees, a fact that made my brain boil when I tried to add in the labels, because I was expecting different numbers to come back from my calculations ...
I was keen on passing the chart values in as array, so I could gather data from an HTML table with a couple of lines of JS, for example. I left this out in the little demo that I mocked up, which I uploaded as a zip file as well, but I am sure you guys figure what I mean.
The whole thing is nothing new, and Plotkit or Bluff are way more advanced, but I think it's a nice little demo to read and understand, without being overwhelmed by large files of code. So I hope you enjoy it.
Comments
by Reisekrankenversicherung on July 22 2009, 14:56 #
by Flug on March 9 2009, 17:16 #
by Matthew Knott on May 12 2009, 09:32 #
by Jason Grant on April 9 2009, 12:00 #