<canvas> allow a developer to acheive?
The
<canvas>element allows a developer to draw 2D graphics using JavaScript code. It provides a region that can be manipulated via a JavaScript interface.
</canvas> tag?
The closing
</canvas>tag is important because the<canvas>element requires an opening and closing tag, (unlike the<img>element). Any content between the opening and closing tags is fallback content that will only display if the browser does not support the<canvas>element.
The
getContext()method returns a rendering context object that provides methods and properties for drawing on the<canvas>. It takes one parameter, the context type such as ‘2d’, and returns an instance of a context interface like CanvasRenderingContext2D. This context interface exposes methods likefillRect()andstrokeRect()that can be used to draw different shapes and graphics. SogetContext()provides the actual drawing API after it is called on a<canvas>element.
it’s a charting library for javascript
Area, Bar, Bubble
###
humans are visual, charts are more visual than tables
cookie-stand: we could see a bar graph of sales per location/hour at a glance odd-duck: we can visualize which products are ones we should prioritize