minuit

ChartComponent

Lines, areas or bars, one or several series, with ticks, a legend and a crosshair.

Java

Inside a PanelComponent constructor. The same call draws in every family and chroma.

Java
// A static chart: the samples fill the width.
ChartComponent sales = add(new ChartComponent(at(new Box("sales", 10, 10, 200, 90)))
        .mode(ChartComponent.Mode.BAR)
        .title(words.get("mymod.sales"))
        .categories(List.of("Mon", "Tue", "Wed")));
sales.addSeries(words.get("mymod.iron")).set(4, 9, 6);
sales.addSeries(words.get("mymod.gold")).set(1, 3, 2);

// A live graph: the newest sample is on the right. Series.add does not allocate.
ChartComponent fps = add(new ChartComponent(at(new Box("fps", 10, 10, 200, 60))).live(240).unit(" fps"));
ChartComponent.Series line = fps.addSeries("FPS");
line.add(currentFps); // once a frame or once a tick

Variants

Line

ChartComponent, line

Bar

ChartComponent, bar