0👍
Unlike the <img>
element, the <canvas>
element requires a separate closing tag (</canvas>).
Try replacing the canvas elements in your code with the below.
<canvas id="graph1" height="500" width="700"></canvas>
<canvas id="graph2" height="300" width="500"></canvas>
Source:stackexchange.com