Chart.js, Canvas
JavaScript Canvas
- What does the
<canvas>
allow a developer to achieve?
The <canvas>
HTML element can be used by JavaScript to draw in 2D or 3D space. It is also used by third party APIs to directly add graphic into the canvas space.
- What is the importance of the closing
</canvas>
tag?
The content between the opening and closing tags of the canvas element will be the fallback display if the browser does not support canvas.
- Explain what the
getContext()
method does.
The getContext()
method preps the canvas for the space it will be drawn (2D/3D).
Chart.js Documentation
- What is Chart.js and how it can be brought into your project?
Chart.js is an external library which which is installed onto the browswer when it is called by the HTML document. It uses a script tag to download the package onto the browser when its called upon.
- List 3 different Chart types you can create using Chart.js.
You can create an bar chart, line chart, and radar chart. You can also add area to the line and radar chart types to create area charts.
Easily Create Stunning Animated Charts with Chart.js
- What are some advantages to displaying data via a chart over a table?
Charts can provide a visual representation of results to the reader. With large data sets, tables can be hard to read while charts may be better suited to display the data. It also makes the data feel less overwhelming. It might be easier to see patterns in your data with charts since they provide the visual representation.
- How could Chart.js aid your previously created applications visually?
It would allow a very easy display captured data to the user. In the salmon cookie project, it could be used have one line chart with all the cities on it expressed in different colors. As the user adds cities, it would be cool to lay new lines to the chart.
Things I want to know more about