echarts vue.js制作饼状图

//积分客户饼状图
drawLinepoint() {
// 基于准备好的dom,初始化echarts实例,找到图形容器。
let myChart = this.$echarts.init(document.getElementById('userchart1'));
// 绘制图表
myChart.setOption({
legend: {       //右侧提示状态图
        orient: 'vertical',
        x: 'right',
        data:['500积分以下','500-1000积分','1000-5000积分','5000积分以上'],
        top:'10%',
        right:100,
        itemGap:20,
        width:200,
        textStyle:{
        fontSize:14
        }
    },
    graphic:{
type:'text',
left:'22%',
top:'43%',
style:{
text:'3307',
textAlign:'center',
fill:'#302e33',
fontSize:25
}
},
color:['#ff7474','#ffc95e','#f0a042','#ff9f8c'],
series: [{
name: '积分客户总数',
type: 'pie',
radius: ['45%', '100%'], //调整大小
center: ['30%', '50%'],   //调整位置
avoidLabelOverlap: false,
label: {
normal: {
show: true,
                    position: 'inside',
                    fontSize:'10',
                    formatter:'{d}%'
}
},
labelLine: {
normal: {
show: false
}
},
data: [{
value: 1058,
name: '500积分以下'
}, {
value: 827,
name: '500-1000积分'
}, {
value: 926,
name: '1000-5000积分'
}, {
value: 496,
name: '5000积分以上'
}]
}]
});


},

相关文章:

  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-05-13
  • 2021-09-12
  • 2021-04-26
  • 2021-06-30
  • 2021-08-14
猜你喜欢
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2022-01-23
  • 2021-05-09
相关资源
相似解决方案