console
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Canvas Graph of y = x^2</title>
</head>
<body>
<canvas id="graphCanvas" width="600" height="400" style="border:1px solid #000;"></canvas>
<script>
var canvas = document.getElementById('graphCanvas');
var ctx = canvas.getContext('2d');
canvas.width = 600;
canvas.height = 400;
ctx.beginPath();
ctx.moveTo(100, canvas.height - 50);
ctx.lineTo(100, 50);
ctx.lineTo(canvas.width - 50, 50);
ctx.stroke();
ctx.beginPath();
for (var x = -10; x <= 10; x += 0.1) {
var y = x * x;
var canvasX = 100 + x * 20;
var canvasY = canvas.height - 50 - y * 20;
ctx.lineTo(canvasX, canvasY);
}
ctx.stroke();
</script>
</body>
</html>