1. HTML
<div id="myChart3" :style="{width: '1200px', height: '300px'}"></div>
2.JS
drawpic(){
let myChart = this.$echarts.init(document.getElementById('myChart3'))
// 绘制图表
myChart.setOption({
//title: { text: 'CAR 追踪整体状况' },
tooltip: {
trigger: 'item',
formatter: "{b} :{c} {d}%"// "{a} <br/>{b} :{c} {d}%"
},
series: [{
name:this.PiePicName,
type: 'pie',
data:this.pieData,
}]
});
},
3.Data 里的值
pieData:[
{value:235, name:'视频广告'},
{value:274, name:'联盟广告'},
{value:310, name:'邮件营销'},
{value:335, name:'直接访问'},
{value:400, name:'搜索引擎'}
],