3 ms·
I think most chart libraries use SVG. There are trade-offs between the two approaches and both have their advantages. One of the places that canvas really shine
by benmccann 7y ago
I think most chart libraries use SVG. There are trade-offs between the two approaches and both have their advantages. One of the places that canvas really shines is performance. In the past I've found Chart.js and some of the faster SVG libraries to be about on par with each other, but the upcoming Chart.js 2.9.0 release has had a couple major performance improvements that I think will make it significantly faster than probably any SVG library. It's an area we'll continue to work on since it's one of the main reasons to choose a canvas implementation over an SVG implementation.
I think the other advantage SVG has can be is if you want to do some advanced interactivity. That can sometimes be easier in SVG.
- cseelus 7y agoThank you for your work on Chart.js. I used it exclusively for a couple of years and still think its great.
- tmd83 7y agoSo Chart.js doesn't have a way to generate sharp images for print and such purposes?
- ldad 7y agoThere's an option that'll increase the resolution... options: { devicePixelRatio: 2 }
- etimberg 7y agoFor printing, it should be sharp unless you are have specific print CSS. There's a bunch of discussion in https://github.com/chartjs/Chart.js/issues/1350 https://github.com/chartjs/Chart.js/issues/1350