disable chart legend
This commit is contained in:
parent
1b1ee673bb
commit
09eae78899
BIN
LineChart.exe
BIN
LineChart.exe
Binary file not shown.
30
LineChart.go
30
LineChart.go
@ -191,18 +191,21 @@ func eChart(w http.ResponseWriter, r *http.Request) {
|
||||
chartSeries := cfg.Section("Chart").Key("Series").String()
|
||||
assetsURL := cfg.Section("Chart").Key("AssetsURL").String()
|
||||
|
||||
var xPercent float32 = 75
|
||||
var xPercent float32 = 0
|
||||
if params.Range == "all" {
|
||||
xPercent = 0
|
||||
}
|
||||
if params.Range == "half" {
|
||||
xPercent = 50
|
||||
if params.Range == "3days" {
|
||||
xPercent = 57.14
|
||||
}
|
||||
if params.Range == "quarter" {
|
||||
xPercent = 75
|
||||
if params.Range == "2days" {
|
||||
xPercent = 71.42
|
||||
}
|
||||
if params.Range == "octant" {
|
||||
xPercent = 87.5
|
||||
if params.Range == "1day" {
|
||||
xPercent = 85.71
|
||||
}
|
||||
if params.Range == "12hrs" {
|
||||
xPercent = 92.85
|
||||
}
|
||||
if params.Alias != "" {
|
||||
chartSubtitle = params.Alias
|
||||
@ -257,13 +260,14 @@ func eChart(w http.ResponseWriter, r *http.Request) {
|
||||
Min: "dataMin",
|
||||
Max: "dataMax",
|
||||
AxisLabel: &opts.AxisLabel{
|
||||
Show: true,
|
||||
ShowMinLabel: true,
|
||||
ShowMaxLabel: true,
|
||||
Rotate: 45,
|
||||
FontSize: "14",
|
||||
FontWeight: "600",
|
||||
FontFamily: "Calibri",
|
||||
LineHeight: "200",
|
||||
LineHeight: "250",
|
||||
},
|
||||
},
|
||||
),
|
||||
@ -290,11 +294,11 @@ func eChart(w http.ResponseWriter, r *http.Request) {
|
||||
},
|
||||
},
|
||||
),
|
||||
// charts.WithLegendOpts(
|
||||
// opts.Legend{
|
||||
// Show: true,
|
||||
// },
|
||||
// ),
|
||||
charts.WithLegendOpts(
|
||||
opts.Legend{
|
||||
Show: false,
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
chart.SetXAxis(timeAxis).AddSeries(chartSeries, dots).
|
||||
|
Loading…
x
Reference in New Issue
Block a user