如果一門語言可以用來寫爬蟲,那麼它就需要一個優雅的資料視覺化庫。 ---沃.茲基碩德
在 Golang 這門語言中,目前資料視覺化的第三方庫還是特別少,go-echarts 的開發就是為了填補這部分的空隙。Echarts 是百度開源的非常優秀的視覺化圖表庫,憑藉著良好的互動性,精巧的圖表設計,得到了眾多開發者的認可。也有其他語言為其實現了相應語言版本的介面,如 Python 的 pyecharts,go-echarts 也是借鑑了 pyecharts 的一些設計思想。
? 安裝
$ go get -u github.com/chenjiandongx/go-echarts/...
複製程式碼
✨ 特性
簡潔的 API 設計,使用如絲滑般流暢
囊括了 20+ 種常見圖表,應有盡有
高度靈活的配置項,可輕鬆搭配出精美的圖表
詳細的文件和示例,幫助開發者更快的上手專案
多達 400+ 地圖,為地理資料視覺化提供強有力的支援
? 使用
僅需要幾行核心程式碼就可畫出美觀的圖表

生成的 bar.html 是這樣的。Cool!

當然你也可以使用更加 golang
的方式,利用 net/http

開啟瀏覽器訪問 http://localhost:8081 也可以看到同樣的效果!
? Demo





















執行 example/main.go 可預覽所有示例
$ cd your/gopath/src/github.com/chenjiandongx/go-echarts/example
$ go build .
$ ./example
複製程式碼
瞭解更多文件的內容請訪問 go-echarts.chenjiandongx.com