diff --git a/internal/web/utils.go b/internal/web/utils.go index e8138a7..f6209c3 100644 --- a/internal/web/utils.go +++ b/internal/web/utils.go @@ -93,6 +93,13 @@ func createBarChart(stats []CommandStat) *charts.Bar { Title: "Top Commands", Subtitle: "Most used commands", }), + charts.WithXAxisOpts(opts.XAxis{ + AxisLabel: &opts.AxisLabel{ + Show: opts.Bool(true), + Interval: "0", + Rotate: 45, + }, + }), ) commands := make([]string, len(stats)) @@ -103,13 +110,7 @@ func createBarChart(stats []CommandStat) *charts.Bar { } bar.SetXAxis(commands). - AddSeries("Freq", generateBarItems(counts)). - SetSeriesOptions( - charts.WithLabelOpts(opts.Label{ - Color: "white", - Position: "top", - }), - ) + AddSeries("Freq", generateBarItems(counts)) return bar } @@ -119,6 +120,7 @@ func generateBarItems(data []int) []opts.BarData { for i, v := range data { items[i] = opts.BarData{Value: v} } + log.Printf("items: %#v", items) return items }