Skip to content

Commit 86feae9

Browse files
author
cg33
committed
add echarts
1 parent 49c2fde commit 86feae9

File tree

4 files changed

+4307
-0
lines changed

4 files changed

+4307
-0
lines changed

echarts/chart.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ package echarts
22

33
import (
44
"bytes"
5+
"encoding/json"
56
"github.com/go-echarts/go-echarts/charts"
7+
"github.com/go-echarts/go-echarts/datasets"
8+
"github.com/go-echarts/go-echarts/templates"
69
"html/template"
710
"strings"
811
)
@@ -12,6 +15,16 @@ type Chart struct {
1215
}
1316

1417
func NewChart() *Chart {
18+
19+
templates.BaseTpl = List["base"]
20+
templates.ChartTpl = List["chart"]
21+
templates.HeaderTpl = List["header"]
22+
templates.PageTpl = List["page"]
23+
templates.RoutersTpl = List["routes"]
24+
25+
_ = json.Unmarshal([]byte(coorJson), &datasets.Coordinates)
26+
_ = json.Unmarshal([]byte(mapfileName), &datasets.MapFileNames)
27+
1528
return new(Chart)
1629
}
1730

0 commit comments

Comments
 (0)