Chart.js and Canvas
Canvas
JavaScript Canvas
- The canvas tag allows a dev to make 2d graphics in JavaScript. It requires a hight and width.
- It requires a closing tag unlike img elements because all the content inside the brackets is fallback content.
- teh getContext method allows you to render content.
Chart.js Docs
- Chart.js is a tool you can use to add charts to your JS.
- 3 chart types:
- bar chart
- donut/pie charts
- line chart
Create Animated Charts with Charts.js
- Charts are better for data than a table because they can be visual instead of just numbers on a screen.
- Chart.js can be used to make the outcome of the results look better.