5 ms·
A bit of the shame on the interactivity: "If you are looking to add interaction as a layer to charts, Chart.js is not the library for you. A better option woul
by nicpottier 14y ago
A bit of the shame on the interactivity:
"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?
- HNLogInShit 14y agoRollovers are lame. The user should not be sweeping every pixel on the screen to find hidden goodies. Let's put a stop to shitty Easter-egg UI.
- james33 14y agoI completely agree, without user interaction these charts aren't all that useful for most cases. I make games using HTML5, and it is quite easy to interpret user input such as mouse over/out on the canvas.
- jahewson 14y agoWhy not just use SVG? What browser supports Canvas but not SVG? Edit: The answer is Android < version 3.0. The author claims that iOS < 5.0 doesn't support SVG but that's not true
- Hovertruck 14y agoWe actually have our own in-house charting library at Chartbeat that uses Canvas that does exactly that (roll over the main chart): http://chartbeat.com/publishing/demo/ http://chartbeat.com/publishing/demo/
- nicpottier 14y agoNice! FYI, those charts are VERY fuzzy on my retina display. :(
- Hovertruck 14y agoYeah. We're actually in the process of moving to D3 partly because of this. :\
- webmonks 14y agoWe recently released an HTML5 Canvas Based Charting Library that supports Interactivity. Its not free though http://canvasjs.com/ http://canvasjs.com/
- tagliala 14y agoI have a little application with charts. I was using jqplot but IMHO it was too heavy and I started googling for a lighter solution. I found flot. flot is based on canvas and has user interaction. I don't know how it is implemented (btw flot is mit licensed) but it works. it's a shame that this library doesn't support user interaction http://people.iola.dk/olau/flot/examples/interacting.html http://people.iola.dk/olau/flot/examples/interacting.html