Chapter 06 · Dart + browser APIs

One series model, two plot forms.

Render named point series as a connected line plot and a scatter plot. Both use Dart linear scales and immediate Canvas drawing.

Canvas line plot

Canvas 2D is required.

Canvas scatter plot

Canvas 2D is required.

Loading the Dart application…

How it works

The HTML is a static template. JSON supplies values or drawing data. Dart owns rendering and browser events; boot.js registers small JavaScript handlers through LMDart.register.

renderPlot(lineCanvas, data['line']);
renderPlot(scatterCanvas, data['scatter'], scatter: true);