From 4b7bd8676d5a84269ccd04698d54cee5fb6e1806 Mon Sep 17 00:00:00 2001 From: gucio321 Date: Thu, 14 Dec 2023 14:44:11 +0100 Subject: [PATCH] plot: add LineXY --- Plot.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Plot.go b/Plot.go index 766397af..1215418c 100644 --- a/Plot.go +++ b/Plot.go @@ -441,9 +441,16 @@ func (p *LineXYPlot) Offset(offset int) *LineXYPlot { // Plot implements Plot interface. func (p *LineXYPlot) Plot() { - // TODO: migrate this - // imgui.ImPlotSetPlotYAxis(imgui.ImPlotYAxis(p.yAxis)) - // imgui.ImPlotLineXY(Context.FontAtlas.RegisterString(p.title), p.xs, p.ys, p.offset) + imgui.PlotSetAxis(imgui.PlotAxisEnum(p.yAxis)) + imgui.PlotPlotLinedoublePtrdoublePtrV( + Context.FontAtlas.RegisterString(p.title), + &p.xs, + &p.ys, + int32(len(p.xs)), + 0, // flags + int32(p.offset), + 8, // sizeof(double) = 8 + ) } // PieChartPlot represents a pie chart.