reading-notes

Readings: Chart.js

What does the allow a developer to acheive?

Canvas is a set of tools and JavaScript APIs that you can use to expose an application as a canvas app.

What is the importance of the closing `</canvas> tag?

The tag is used to draw graphics, on the fly, via scripting (usually JavaScript). The tag is transparent, and is only a container for graphics, you must use a script to actually draw the graphics. https://www.w3schools.com/tags/tag_canvas.asp#:~:text=Definition%20and%20Usage,to%20actually%20draw%20the%20graphics.

Explain what the getContext() method does

eturns a drawing context on the canvas, or null if the context identifier is not supported, or the canvas has already been set to a different context mode. https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext#:~:text=The%20HTMLCanvasElement.getContext()%20method,to%20a%20different%20context%20mode.

What is Chart.js and how it can be brought into your project?

a popular open-source library for visualizing data. It allows you to create different types of charts from datasets such as bar charts, pie, line, donut, scatters, and many more. https://www.stanleyulili.com/javascript/beginner-guide-to-chartjs/#:~:text=Introduction-,Chart.,to%20draw%20charts%20with%20Chart.

## List 3 different Chart types you can create using Chart.js.

Scatter Plot. Line Chart. Bar Chart.

What are some advantages to displaying data via a chart over a table?

Charts can show a large amount of data quickly in a way that is easy to process, without distracting people with a bunch of numbers. https://infogram.com/blog/do-you-know-when-to-use-tables-vs-charts/#:~:text=Charts%20can%20show%20a%20large,overall%20shape%20of%20your%20data.

How could Chart.js aid your previously created applications visually?

hart. js renders its charts using the Canvas element which results in good performance compared with SVG, espcially when rendering a large amount of data. The other advantage of Canvas rendering is that it’s relatively easy to download the chart as an image file. https://createwithdata.com/d3js-or-chartjs/#:~:text=widths%20and%20more.-,Chart.,chart%20as%20an%20image%20file.