該模板用以顯示使用Apache Echarts 5渲染的圖表,使用以下5個參數:
[[Special:ChangeContentModel/【頁面名稱】]];例如User:AnnAngela/contributions);
<nowiki>標籤包裹這個JSON片段以防止模板意外閉合)。px為單位),若該值無法解析為整數或小於等於160則按1200解析;px為單位),若該值無法解析為整數或小於等於90則按675解析;debug=1則頁面只會加載debug版本)。{{Echart}}可以同時繪製多個數據系列,但如果出於排版等的考慮,需要在一個頁面內多次調用這一模板時,除了最後一次調用外之前每次都需要加上draw=off。注意:由於安全原因,本模板加載的數據不接受html字符串,有需要的請使用richText。(即html字符串會被格式化不會加載,以避免諸如該示例中的XSS攻擊)
示例如下:
{{Echart|datapage=User:AnnAngela/contributions|height=370}}
"title": {
"text": "我的編輯歷史(不含自動工具、機器人編輯)",
"subtext": "按月統計次數(截至 2020 年 4 月 15 日 21:50)",
"subtextStyle": {
"color": "#333"
}
},
"tooltip": {
"trigger": "axis",
"axisPointer": {
"type": "cross",
"animation": false
}
},
"toolbox": {
"show": true,
"feature": {
"dataZoom": {
"yAxisIndex": "none"
},
"dataView": {
"readOnly": true
},
"magicType": {
"type": [
"line",
"bar"
]
},
"restore": {},
"saveAsImage": {
"excludeComponents": [
"toolbox",
"dataZoom"
]
}
}
},
"axisPointer": {
"link": {
"xAxisIndex": "all"
}
},
"dataZoom": [
{
"type": "inside",
"xAxisIndex": [
0
],
"startValue": 0,
"end": 100
},
{
"show": true,
"xAxisIndex": [
0
],
"type": "slider",
"start": 0,
"end": 100
}
],
"legend": {
"data": [
"編輯次數"
]
},
"xAxis": {
"data": [
"2014年8月",
"2014年9月",
"2014年10月",
"2014年11月",
"2014年12月",
"2015年1月",
"2015年2月",
"2015年3月",
"2015年4月",
"2015年5月",
"2015年6月",
"2015年7月",
"2015年8月",
"2015年9月",
"2015年10月",
"2015年11月",
"2015年12月",
"2016年1月",
"2016年2月",
"2016年3月",
"2016年4月",
"2016年5月",
"2016年6月",
"2016年7月",
"2016年8月",
"2016年9月",
"2016年10月",
"2016年11月",
"2016年12月",
"2017年1月",
"2017年2月",
"2017年3月",
"2017年4月",
"2017年5月",
"2017年6月",
"2017年7月",
"2017年8月",
"2017年9月",
"2017年10月",
"2017年11月",
"2017年12月",
"2018年1月",
"2018年2月",
"2018年3月",
"2018年4月",
"2018年5月",
"2018年6月",
"2018年7月",
"2018年8月",
"2018年9月",
"2018年10月",
"2018年11月",
"2018年12月",
"2019年1月",
"2019年2月",
"2019年3月",
"2019年4月",
"2019年5月",
"2019年6月",
"2019年7月",
"2019年8月",
"2019年9月",
"2019年10月",
"2019年11月",
"2019年12月",
"2020年1月",
"2020年2月",
"2020年3月",
"2020年4月"
]
},
"yAxis": {},
"series": [
{
"name": "每月編輯數",
"type": "line",
"label": {
"formatter": "{c}",
"distance": 0,
"backgroundColor": "#fff",
"padding": 1
},
"data": [
{
"value": 99,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 674,
"label": {
"show": true
}
},
{
"value": 585,
"label": {
"show": true
}
},
{
"value": 317,
"label": {
"show": true
}
},
{
"value": 154,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 373,
"label": {
"show": true
}
},
{
"value": 810,
"label": {
"show": true,
"position": "left"
}
},
{
"value": 829,
"label": {
"show": true
}
},
{
"value": 385,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 868,
"label": {
"show": true
}
},
{
"value": 957,
"label": {
"show": true
}
},
{
"value": 314,
"label": {
"show": true
}
},
{
"value": 278,
"label": {
"show": true
}
},
{
"value": 243,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 423,
"label": {
"show": true
}
},
{
"value": 238,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 975,
"label": {
"show": false
}
},
{
"value": 598,
"label": {
"show": true
}
},
{
"value": 493,
"label": {
"show": true
}
},
{
"value": 377,
"label": {
"show": true
}
},
{
"value": 308,
"label": {
"show": true
}
},
{
"value": 119,
"label": {
"show": true
}
},
{
"value": 110,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 177,
"label": {
"show": true
}
},
{
"value": 397,
"label": {
"show": true
}
},
{
"value": 76,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 231,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 329,
"label": {
"show": true
}
},
{
"value": 230,
"label": {
"show": true
}
},
{
"value": 187,
"label": {
"show": true
}
},
{
"value": 125,
"label": {
"show": true
}
},
{
"value": 76,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 190,
"label": {
"show": true
}
},
{
"value": 156,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 118,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 141,
"label": {
"show": true
}
},
{
"value": 213,
"label": {
"show": true
}
},
{
"value": 46,
"label": {
"show": true,
"position": "left"
}
},
{
"value": 80,
"label": {
"show": true
}
},
{
"value": 86,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 165,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 167,
"label": {
"show": true
}
},
{
"value": 97,
"label": {
"show": true,
"position": "right"
}
},
{
"value": 270,
"label": {
"show": true
}
},
{
"value": 50,
"label": {
"show": true,
"position": "left"
}
},
{
"value": 27,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 58,
"label": {
"show": true
}
},
{
"value": 70,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 111,
"label": {
"show": true
}
},
{
"value": 43,
"label": {
"show": true
}
},
{
"value": 40,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 69,
"label": {
"show": true
}
},
{
"value": 80,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 395,
"label": {
"show": true
}
},
{
"value": 246,
"label": {
"show": true
}
},
{
"value": 68,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 184,
"label": {
"show": true
}
},
{
"value": 83,
"label": {
"show": true
}
},
{
"value": 61,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 118,
"label": {
"show": true
}
},
{
"value": 111,
"label": {
"show": true,
"position": "bottom"
}
},
{
"value": 293,
"label": {
"show": true
}
},
{
"value": 87,
"label": {
"show": true,
"position": "left"
}
},
{
"value": 15,
"label": {
"show": false
}
},
{
"value": 76,
"label": {
"show": true,
"position": "right"
}
},
{
"value": 425,
"label": {
"show": true
}
},
{
"value": 771,
"label": {
"show": true
}
},
{
"value": 727,
"label": {
"show": true
}
},
{
"value": 341,
"label": {
"show": true
}
}
],
"markPoint": {
"data": [
{
"type": "max",
"name": "最大值"
},
{
"type": "min",
"name": "最小值"
}
]
},
"markLine": {
"data": [
{
"type": "average",
"name": "平均值"
}
]
}
}
],
"animation": false
}