From d3af9e1113284d39ba4ce71dde32ef2ac65d84a9 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Fri, 27 Oct 2023 16:47:31 -0600 Subject: [PATCH] fix ui default --- ana/prediction.go | 3 ++- cmd/clitest/index.html | 2 +- cmd/clitest/main.go | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ana/prediction.go b/ana/prediction.go index 13f678b..a2ae911 100644 --- a/ana/prediction.go +++ b/ana/prediction.go @@ -38,7 +38,8 @@ func (prediction Prediction) predict(latest ledger.Balances, from time.Time, the func (prediction Prediction) predictOne(balances ledger.Balances, elapsed time.Duration) ledger.Balances { for i := range prediction { - balances = prediction[i](balances, elapsed) + next := prediction[i](balances, elapsed) + balances = next } return balances } diff --git a/cmd/clitest/index.html b/cmd/clitest/index.html index 6fd5130..cbb3102 100644 --- a/cmd/clitest/index.html +++ b/cmd/clitest/index.html @@ -65,7 +65,7 @@ - + diff --git a/cmd/clitest/main.go b/cmd/clitest/main.go index 36738e4..f8bec05 100644 --- a/cmd/clitest/main.go +++ b/cmd/clitest/main.go @@ -234,7 +234,6 @@ func main() { } primary := toChart(r.URL.Path == "/bal", r.URL.Query().Get("chart"), register) if len(predicted) > 0 { - log.Printf("overlapping predicted: %+v", predicted) primary.Overlap(toChart(r.URL.Path == "/bal", "line", predicted)) } if err := primary.Render(w); err != nil { @@ -343,7 +342,10 @@ func (line Line) AddY(name string, v []int) { for i := range y { y[i].Value = v[i] } - line.AddSeries(name, y) + line.AddSeries(name, y). + SetSeriesOptions(charts.WithBarChartOpts(opts.BarChart{ + Stack: "stackB", + })) } func (line Line) Overlap(other Chart) {