Chapter 04 · Java + TeaVM

Shared data, connected points.

Multiple named series share Cartesian scales and axes. Each series becomes a path with point markers and a generated legend.

Starting the TeaVM application…

How it works

Series contains a name, color, and Point2D values. LineChart derives its domain from all points, including single-point domain padding, then draws through Graphics2D.

Series series = new Series("TeaVM", "#61d6c5", List.of(
    new Point2D(1, 18), new Point2D(2, 27),
    new Point2D(3, 25), new Point2D(4, 42)));
LineChart chart = new LineChart("Adoption", List.of(series));
chart.render(graphics);