- 在echarts option配置项中引入图片, 需要使用绝对路径
1 代码示例
import active from '@/assets/images/echarts/active.png';
import unActive from '@/assets/images/echarts/unActive.png';
const _active = `image://${active}`; // 写法参考官网配置项手册
const _unActive = `image://${unActive}`;
// option中涉及引入图片地方的配置项
{
"type": "scatter",
"coordinateSystem": "geo",
"data": [{
"name": "江苏省",
"value": ["118.796624", "32.059344"],
"symbol": _active,
"symbolSize": [20, 20]
}]
}
网友评论