You don't draw directly on the canvas element. You draw on the context. The context can be 2D or 3D. To draw a line you need a starting x and y value and an ending x and y value. Create lastX and ...
HTML5 Canvas Gauge. Tiny implementation of highly configurable gauge using pure JavaScript and HTML5 canvas. No dependencies. Suitable for IoT devices because of minimum code base.