2021SC@SDUSC
目录
一、前言
本文分析的是,amis框架中的Chart图表
二、代码分析
基本用法
{
"type": "page",
"body": {
"type": "chart",
"api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/chart/chart",
"interval": 5000
}
}
api 返回支持两种格式,一种是直接返回完整 echarts 配置,数据包含在配置里,具体格式请参考后面的静态数据写法,另一种是返回纯数据,具体请参考动态数据写法。
静态数据
在 config
里填写完整的 echarts 配置,这里的数据是静态的。
type": "page",
"body": {
"type": "chart",
"config": {
"title": {
"text": "极坐标双数值轴"
},
"legend": {
"data": [
"line"
]
},
"polar": {
"center": [
"50%",
"54%"
]
},
"tooltip": {
"trigger": "axis",
"axisPointer": {
"type": "cross"
}
},
"angleAxis": {
"type": "value",
"startAngle": 0
},
"radiusAxis": {
"min": 0
},
"series": [
{
"coo