When comparing Chart.js vs D3.js, the Slant community recommends Chart.js for most people. In the question“What are the best JavaScript charting libraries? ” Chart.js is ranked 1st while D3.js is ranked 2nd. The most important reason people chose Chart.js is:
The library contains a set of 6 charts and is 11Kb gzipped, this makes its loading time and page impact low.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Lightweight and fast
The library contains a set of 6 charts and is 11Kb gzipped, this makes its loading time and page impact low.
Pro Responsive charts
The charts are fully responsive, meaning they resize based on the viewport width.
Pro Clear documentation
The chart.js documentation is well organized and provides detailed information on using each feature.
Pro Plugin support
Many plugins available via NPM and you can easily write your own
Pro Large community
D3.js is a very popular tool with an active community, resulting in plenty of learning resources and fast responses to questions.
Pro Huge number of examples online
Most of the examples provided are by the author, but there's also a great community writing plugins and more examples.
Pro Doesn't require a proprietary framework
D3's emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework.
Pro Versatile library for manipulating data on the DOM
Pro Very flexible join paradigm
Can be tricky at first, but once learned, data manipulation and binding can easily generate complex visualizations for massive amounts of data.
Pro Great for highly interactive scenes
D3.js offers incredible levels of interactivity.
Pro Backwards compatible
D3.js is intended for modern browsers, so supports IE9 and above (IE8 with an additional library) as well as all the other modern browsers.
Cons
Con Limited features
Chart.js currently offers only 6 graph types, and lacks the flexibility offered by other options. For example, controlling the display of tooltips is fairly limited.
Con Canvas based
Canvas it bitmap based and shares the same issues as non-vector formats.
Con Steep learning curve
The complexity and flexibility of D3.js results in it being a time-consuming tool to learn for many users.
D3 is incredibly flexible; probably more so than any other JavaScript visualization library at the time of this posting. With that flexibility comes increased complexity. If you just want to create some quick charts you will get results faster with something else.
Con "Selections" are elegant, but somewhat hard to grok
Selections are core to working with D3 beyond the basics. They're powerful and useful, but require new developers to get up to speed (e.g. set aside 30m to read and digest: https://github.com/mbostock/d3/wiki/Selections) and if used in the context of a larger application will result in a portion of the code using different patterns than the rest, requiring a translation layer in between.