Skip to content

GUI Chart

App: apps/gui_chart/

Demonstrates both Nuklear chart types: an animated line chart driven by a sine wave, and a column chart with static data.

Terminal window
% ./plume3d gui_chart
  • Line chart (type=0) — 30 data points pushed each frame from Math.sin(_time * 2 + i * 0.4), giving a scrolling animated wave. Range: −1 to 1.
  • Column chart (type=1) — 10 fixed values in 0–100 range, rendered as vertical bars.
  • Uses chartBegin / chartPush / chartEnd pattern — push exactly count values between begin and end.
// Animated sine wave
Gui.layoutRowDynamic(150, 1)
if (Gui.chartBegin(0, 30, -1, 1)) { // type=0 (line), 30 points
for (i in 0...30) {
Gui.chartPush(Math.sin(_time * 2 + i * 0.4))
}
Gui.chartEnd()
}
// Static column chart
if (Gui.chartBegin(1, _data.count, 0, 100)) { // type=1 (column)
for (v in _data) Gui.chartPush(v)
Gui.chartEnd()
}
  • GuichartBegin, chartBeginColored, chartPush, chartEnd.
  • Mathsin.