在vue中使用echarts的树图怎样自定义图片
export default{
data(){
return{
imgs:require("../../assets/images/imgs.png"),//变量保存imgs地址
imgsBase64:' ',//定义一个变量保存图片的base64码
imgs1:require("../../assets/images/imgs1.png"),
imgs1Base64:' ',
imgs2:require("../../assets/images/imgs2.png"),
imgs2Base64:' ',
treeData:[],
}
},
mounted(){
this.getCharts();
this.getBase64()
},
methods:{
getCharts(){
//从后台获取数据传给画图的方法
this.treeData=[]
let json={}
json.symbol="image://"+`${this.imgsBase64}`
json.symbolSize=[130,80]
json.children=[]
this.treeData.push(json)
this.$nextTick(()=>{
this.drawCharts(this.treeData);
})
} ,
drawCharts(data){
let that=this;
that.$echarts.init(document.getElementById('myChart')).clear();
that.myChart=echarts.init(document.getElementById('myChar