fix ui default
parent
35011bc005
commit
d3af9e1113
|
|
@ -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 {
|
func (prediction Prediction) predictOne(balances ledger.Balances, elapsed time.Duration) ledger.Balances {
|
||||||
for i := range prediction {
|
for i := range prediction {
|
||||||
balances = prediction[i](balances, elapsed)
|
next := prediction[i](balances, elapsed)
|
||||||
|
balances = next
|
||||||
}
|
}
|
||||||
return balances
|
return balances
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
<label for="prediction">prediction</label>
|
<label for="prediction">prediction</label>
|
||||||
<input name="prediction" type="text" value="contributions=&interest=AssetAccount:Cash USD 0.02"/>
|
<input name="prediction" type="text" value="contributions=&prediction=interest=AssetAccount:Cash \$ 0.02"/>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,6 @@ func main() {
|
||||||
}
|
}
|
||||||
primary := toChart(r.URL.Path == "/bal", r.URL.Query().Get("chart"), register)
|
primary := toChart(r.URL.Path == "/bal", r.URL.Query().Get("chart"), register)
|
||||||
if len(predicted) > 0 {
|
if len(predicted) > 0 {
|
||||||
log.Printf("overlapping predicted: %+v", predicted)
|
|
||||||
primary.Overlap(toChart(r.URL.Path == "/bal", "line", predicted))
|
primary.Overlap(toChart(r.URL.Path == "/bal", "line", predicted))
|
||||||
}
|
}
|
||||||
if err := primary.Render(w); err != nil {
|
if err := primary.Render(w); err != nil {
|
||||||
|
|
@ -343,7 +342,10 @@ func (line Line) AddY(name string, v []int) {
|
||||||
for i := range y {
|
for i := range y {
|
||||||
y[i].Value = v[i]
|
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) {
|
func (line Line) Overlap(other Chart) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue