feat: support customize title

This commit is contained in:
vicanso 2021-12-29 23:18:41 +08:00
parent 2772798122
commit 06c326bdc3
9 changed files with 170 additions and 44 deletions

View file

@ -55,8 +55,8 @@ var chartOptions = []map[string]string{
"title": "折线图",
"option": `{
"title": {
"text": "Line",
"textAlign": "left",
"text": "Line\nHello World",
"left": "right",
"textStyle": {
"fontSize": 24,
"height": 40
@ -363,6 +363,9 @@ func render(opts renderOptions) ([]byte, error) {
}
func indexHandler(w http.ResponseWriter, r *http.Request) {
if r.RequestURI != "/" {
return
}
query := r.URL.Query()
opts := renderOptions{
theme: query.Get("theme"),