feat: support fill area of line chart

This commit is contained in:
vicanso 2022-08-25 20:19:05 +08:00
parent 93e03856ca
commit dc1a89d3ff
6 changed files with 130 additions and 1 deletions

View file

@ -2,6 +2,7 @@ package main
import (
"bytes"
"fmt"
"net/http"
"strconv"
@ -261,6 +262,35 @@ func indexHandler(w http.ResponseWriter, req *http.Request) {
},
},
},
{
Title: charts.TitleOption{
Text: "Line Area",
},
Legend: charts.NewLegendOption([]string{
"Email",
}),
XAxis: charts.NewXAxisOption([]string{
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun",
}),
SeriesList: []charts.Series{
charts.NewSeriesFromValues([]float64{
120,
132,
101,
134,
90,
230,
210,
}),
},
FillArea: true,
},
// 柱状图
{
Title: charts.TitleOption{
@ -1935,5 +1965,6 @@ func echartsHandler(w http.ResponseWriter, req *http.Request) {
func main() {
http.HandleFunc("/", indexHandler)
http.HandleFunc("/echarts", echartsHandler)
fmt.Println("http://127.0.0.1:3012/")
http.ListenAndServe(":3012", nil)
}