Chart.js - open source HTML5 charting library
chartjs.org
chartjs.org
"If you are looking to add interaction as a layer to charts, Chart.js is not the library for you. A better option would be using SVG, as this will let you attach event listeners to any of the elements in the chart, as these are all DOM nodes."
Most charts are far more useful with rollovers to let the user interpret the data. I'd say this is a must have for most anything where you really are trying to give the user insight into the dataset.
Also seems to be a bit of a punt by saying this just isn't possible in Canvas. We know where the cursor is no? And we know where the points are. So can't we react to the cursor hovering over a point? What am I missing?
Edit: The answer is Android < version 3.0. The author claims that iOS < 5.0 doesn't support SVG but that's not true
Would love to see this MIT licensed.
I would love to see you rewarded for this project. Donations or a commercial support licence?
edit: I meant to say that I can't play with them as far as I can tell. Is there a way that I'm missing?
Also, the pie chart and doughnut charts seem odd. The general rule is to order the values clockwise (biggest piece starts in top middle and extends to the right). It really helps readability and is a convention.
Keep up the good work!
A great start! Definitely room to grow.
edit: any reason you decided not to use D3 for this?
"Chart.js uses the canvas element, which is a single DOM node, similar in characteristics to a static image. This does mean that it has a wider scope for compatibility, and less memory implications than SVG based charting solutions. The canvas element also allows for saving the contents as a base 64 string, allowing saving the chart as an image.
In SVG, all of the lines, data points and everything you see is a DOM node. As a result of this, complex charts with a lot of intricacies, or many charts on the page will often see dips in performance when scrolling or generating the chart, especially when there are multiple on the page. SVG also has relatively poor mobile support, with Android not supporting SVG at all before version 3.0, and iOS before 5.0. (caniuse.com/svg-html5)."
$('canvas').click(function() { window.open( this.toDataURL("image/png") , 'Serialized Canvas' , 'height=' + this.height + 'width=' + this.width ); });
This will popup a png version of a canvas graph if you click it.
http://omnipotent.net/jquery.sparkline
Is that implementation compatible with your library? I'd love to be able to see exact datapoints.
Also, adding sparklines would make this a great all-in-one charting tool.
I wanted Chart.js to be dependency free, which has led to a footprint of only ~4.4kb when minified and gzipped, d3 is a lot more complex, and has a gzipped size of about 10x that.
It'll have to be up to you whether canvas is the right solution in your use case over SVG!
Interactivity is just a feature. What's the real benefit and purpose? So users can navigate the data? OK, then what? So they can find meaning hidden in the data? Code capable of multidimensional analysis is going to be more effective than eyeballing a 2 dimensional representation of the data.
Don't force your users to move the mouse around, hover, click, and search around for meaning.
For all charts, figure out what story you want to tell, then tell that story. Don't force your user to search for meaning.
http://en.wikipedia.org/wiki/Back-formation
Basically, someone interprets "orientation" as having a stem of "orientate" analogous to how "contemplation" has a stem of "contemplate". Of course, the real stem is "orient".
I would love support for a vertical and horizontal stacked bar chart for things like budget break-downs and general side-by-side comparisons.
Your Y axis has too many values in my opinion. I know it can be hard to code, but I think the example charts can do without the *5 values.
Great job!
It has been taken down. Looks like the project ran into some trouble.
I haven't played with it yet and there seems no labels and/or legend support in pie charts.
I really wanted to use this for my blog.
Looks great btw.
Otherwise, good job. Like other said, interactivity is lacking though
Wrote the content in plain HTML, and used jQuery to build the nav on left hand side from the headings on the page.
This is a canvas JS library.