Previous: Preparing for print
Next: Rich Text Editor V something else

Canvas Based Bar Graph

Note: Click here for the follow on to this article.

I recently wrote about how I'd modified a great example of creating a pie chart using the canvas tag and javascript. I've now written a bar graphing function based on the same principal of dynamically building the chart from tabulated data and building it to the size of the canvas tag.

This will form part of a charting component I'm writing, and although this example only builds a simple bar graph, the finished product will let you compare multiple bar values, plot trend lines, line graphs and scatter graphs. It's just a matter of doing it and making it more flexible.

I'll upload the source code once I've streamilined it a bit, the features are:

  • Dynamically builds background and adjusts based on canvas size. tiny or full screen the proportions of the graph are retained.
  • Positions values dynamically.
  • Builds dynamically from tabulated data.

Source should be up later in the week, good night all.

 

 

Comments

No comments have been added.

Add a comment

0 comments

Latest Tweets

  • @sonnytoiparker http://twitpic.com/2kkard - Which one's Tommy's?

  • @nineplanfailed Sounds like my lunch

  • @nicfranc Have you seen the Epic Citadel demo on iPhone / iPad? oooooooh shiny

  • @LisaMedcalf Dunno what's happening with the house until next week, wankers essentially want me to put a new roof on!

  • @LisaMedcalf Aww cool! I saw a girl on a moped who looked a bit like you and I thought a scooter would be a good idea. Cool, cheap, fun ...

Follow Me