feat: support split line show option for charts, #69

This commit is contained in:
vicanso 2024-02-11 12:36:26 +08:00
parent c7c0655113
commit f1a231ff4b
13 changed files with 23 additions and 21 deletions

View file

@ -2,7 +2,6 @@ package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
@ -17,7 +16,7 @@ func writeFile(buf []byte) error {
}
file := filepath.Join(tmpPath, "line-chart.png")
err = ioutil.WriteFile(file, buf, 0600)
err = os.WriteFile(file, buf, 0600)
if err != nil {
return err
}
@ -97,6 +96,11 @@ func main() {
Top: 5,
Bottom: 10,
}
opt.YAxisOptions = []charts.YAxisOption{
{
SplitLineShow: charts.FalseFlag(),
},
}
opt.SymbolShow = charts.FalseFlag()
opt.LineStrokeWidth = 1
opt.ValueFormatter = func(f float64) string {