Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Thank you for your work on Chart.js. I used it exclusively for a couple of years and still think its great.


So Chart.js doesn't have a way to generate sharp images for print and such purposes?


For 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


There's an option that'll increase the resolution...

options: { devicePixelRatio: 2 }




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: