Fix Chart appearance
All checks were successful
/ release (push) Successful in 30s

This commit is contained in:
Samuel Lorch 2024-07-13 03:46:55 +02:00
parent 38219f7b07
commit 091ef322d5

View file

@ -9,7 +9,6 @@ import (
"git.lastassault.de/speatzle/morffix/constants"
"github.com/go-echarts/go-echarts/v2/charts"
"github.com/go-echarts/go-echarts/v2/opts"
"github.com/go-echarts/go-echarts/v2/types"
"github.com/jackc/pgx/v5"
)
@ -52,18 +51,19 @@ func handleStats(w http.ResponseWriter, r *http.Request) {
pie := charts.NewPie()
pie.SetGlobalOptions(
charts.WithInitializationOpts(opts.Initialization{
Theme: types.ThemePurplePassion,
Theme: "dark",
BackgroundColor: "#111",
}),
charts.WithTitleOpts(opts.Title{
Title: "Codecs",
}))
pie.AddSeries("Codecs", chartData).SetSeriesOptions(charts.WithLabelOpts(
opts.Label{
Show: opts.Bool(true),
Formatter: "{b}: {c}",
Color: "white",
}),
pie.AddSeries("Codecs", chartData).SetSeriesOptions(
charts.WithLabelOpts(
opts.Label{
Show: opts.Bool(true),
Formatter: "{b}: {c}",
}),
)
snippet := pie.RenderSnippet()