Skip to content

Commit 5056391

Browse files
fix: update to use new api
1 parent ef52f5e commit 5056391

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

internal/resources/views/charts.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func GenerateLineChart(series collector.Series, maxPoints int) (string, error) {
6666
line := charts.NewLine()
6767

6868
yopts := opts.YAxis{
69-
Show: false,
69+
Show: opts.Bool(true),
7070
Type: "value",
7171
}
7272
if series.Query.BoolValue {
@@ -83,11 +83,11 @@ func GenerateLineChart(series collector.Series, maxPoints int) (string, error) {
8383
}),
8484
charts.WithYAxisOpts(yopts),
8585
charts.WithXAxisOpts(opts.XAxis{
86-
Show: false,
86+
Show: opts.Bool(true),
8787
Type: "time",
8888
}),
8989
charts.WithLegendOpts(opts.Legend{
90-
Show: false,
90+
Show: opts.Bool(false),
9191
}),
9292
)
9393

@@ -96,8 +96,14 @@ func GenerateLineChart(series collector.Series, maxPoints int) (string, error) {
9696
line.SetXAxis(nil).
9797
AddSeries("Metric", getYAxis(cd)).
9898
SetSeriesOptions(
99-
charts.WithLineChartOpts(opts.LineChart{Smooth: true, Color: "#5c6848"}),
99+
charts.WithLineChartOpts(opts.LineChart{
100+
Smooth: opts.Bool(true),
101+
ShowSymbol: opts.Bool(false),
102+
}),
100103
charts.WithAreaStyleOpts(opts.AreaStyle{Opacity: 0.2, Color: "#5c6848"}),
104+
charts.WithLineStyleOpts(opts.LineStyle{
105+
Color: "#5c6848",
106+
}),
101107
)
102108

103109
cr := newChartRenderer(line, line.Validate)

internal/resources/views/renderer.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"html/template"
66
"io"
77

8+
"github.com/go-echarts/go-echarts/v2/render"
89
chartrender "github.com/go-echarts/go-echarts/v2/render"
910
)
1011

@@ -58,3 +59,11 @@ func (r *chartRenderer) Render(w io.Writer) error {
5859
err := tpl.ExecuteTemplate(w, tplName, r.c)
5960
return err
6061
}
62+
63+
func (r *chartRenderer) RenderContent() []byte {
64+
panic("not implemented")
65+
}
66+
67+
func (r *chartRenderer) RenderSnippet() render.ChartSnippet {
68+
panic("not implemented")
69+
}

0 commit comments

Comments
 (0)