This commit is contained in:
parent
38219f7b07
commit
091ef322d5
1 changed files with 8 additions and 8 deletions
|
@ -9,7 +9,6 @@ import (
|
||||||
"git.lastassault.de/speatzle/morffix/constants"
|
"git.lastassault.de/speatzle/morffix/constants"
|
||||||
"github.com/go-echarts/go-echarts/v2/charts"
|
"github.com/go-echarts/go-echarts/v2/charts"
|
||||||
"github.com/go-echarts/go-echarts/v2/opts"
|
"github.com/go-echarts/go-echarts/v2/opts"
|
||||||
"github.com/go-echarts/go-echarts/v2/types"
|
|
||||||
"github.com/jackc/pgx/v5"
|
"github.com/jackc/pgx/v5"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -52,18 +51,19 @@ func handleStats(w http.ResponseWriter, r *http.Request) {
|
||||||
pie := charts.NewPie()
|
pie := charts.NewPie()
|
||||||
pie.SetGlobalOptions(
|
pie.SetGlobalOptions(
|
||||||
charts.WithInitializationOpts(opts.Initialization{
|
charts.WithInitializationOpts(opts.Initialization{
|
||||||
Theme: types.ThemePurplePassion,
|
Theme: "dark",
|
||||||
|
BackgroundColor: "#111",
|
||||||
}),
|
}),
|
||||||
charts.WithTitleOpts(opts.Title{
|
charts.WithTitleOpts(opts.Title{
|
||||||
Title: "Codecs",
|
Title: "Codecs",
|
||||||
}))
|
}))
|
||||||
|
|
||||||
pie.AddSeries("Codecs", chartData).SetSeriesOptions(charts.WithLabelOpts(
|
pie.AddSeries("Codecs", chartData).SetSeriesOptions(
|
||||||
opts.Label{
|
charts.WithLabelOpts(
|
||||||
Show: opts.Bool(true),
|
opts.Label{
|
||||||
Formatter: "{b}: {c}",
|
Show: opts.Bool(true),
|
||||||
Color: "white",
|
Formatter: "{b}: {c}",
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
snippet := pie.RenderSnippet()
|
snippet := pie.RenderSnippet()
|
||||||
|
|
Loading…
Add table
Reference in a new issue