Extended Shortcode - Echarts
The echarts
shortcode supports data visualization in Hugo with ECharts library.
ECharts is a library helping you to generate interactive data visualization.
The basic chart types ECharts supports include line series, bar series, scatter series, pie charts, candle-stick series, [boxplot series][boxplot] for statistics, map series, heatmap series, lines series for directional information, graph series for relationships, treemap series, sunburst series, parallel series for multi-dimensional data, funnel series, gauge series. And it’s extremely easy to create a combinition of them with ECharts.
Just insert your ECharts option in JSON
/YAML
/TOML
format in the echarts
shortcode and that’s it.
Example echarts
input in JSON
format:
|
|
The same in YAML
format:
|
|
The same in TOML
format:
|
|
The rendered output looks like this:
{"grid":{"bottom":"5%","containLabel":true,"left":"5%","right":"5%","top":"20%"},"legend":{"data":["Email Marketing","Affiliate Advertising","Video Advertising","Direct View","Search Engine"],"top":"10%"},"series":[{"data":[120,132,101,134,90,230,210],"name":"Email Marketing","stack":"Total","type":"line"},{"data":[220,182,191,234,290,330,310],"name":"Affiliate Advertising","stack":"Total","type":"line"},{"data":[150,232,201,154,190,330,410],"name":"Video Advertising","stack":"Total","type":"line"},{"data":[320,332,301,334,390,330,320],"name":"Direct View","stack":"Total","type":"line"},{"data":[820,932,901,934,1290,1330,1320],"name":"Search Engine","stack":"Total","type":"line"}],"title":{"left":"center","text":"Summary Line Chart","top":"2%"},"toolbox":{"feature":{"saveAsImage":{"title":"Save as Image"}}},"tooltip":{"trigger":"axis"},"xAxis":{"boundaryGap":false,"data":["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],"type":"category"},"yAxis":{"type":"value"}}The echarts
shortcode has also the following named parameters:
Related Content
- Extended Shortcode - Mermaid
- Extended Shortcodes Overview
- Built-in Shortcodes
- Shortcodes Test
- Extended Markdown Syntax