echarts绘制饼图+水波球图

效果图

饼图+水波球

代码

let val1dataPie = [
     { name: "test1", value: 10 },
     { name: "test2", value: 20 },
     { name: "test3", value: 30 },
     { name: "test4", value: 10 },
     { name: "test5", value: 40 },
     { name: "test6", value: 60 },
 ];

 let arr = ['middleLost', 57658, val1dataPie, '总计']

 const piegraph = {
     title: {
         show: true,//标题显示
         text: '统计',
         padding: 10,
         textStyle: {
             fontSize:14
         }
     },
     legend: {
         type:'scroll',
         orient: 'vertical',
         right: '10px',
         y:'center',
         top:'20px',
         bottom:'10px',
         icon:'emptyCircle',
         data: ["test1", "test2", "test3", "test4", "test5", "test6"]
     },
     tooltip: {
         show:true,
         trigger:'item',
         formatter: '{b}: {c} ({d}%)'
     },
     series: [{
             type: 'liquidFill',
             radius: '65%',
             itemStyle: {
                 normal: {
                     opacity: 0.4,
                     shadowBlur: 0,
                     shadowColor: 'blue'
                 }
             },
             name: arr[3],
             data: [0.6, 0.5, 0.4, 0.3],
             backgroundStyle: {
                 color: '#ffffff'
             },
             color: [new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                 offset: 0,
                 color: '#79C8F2'
             }, {
                 offset: 1,
                 color: '#E4F3FC'
             }])],
             center: ['35%','50%'],
             label: {
                 normal: {
                     formatter: '',
                 }
             },
             outline: {
                 itemStyle: {
                     borderColor: '#86c5ff',
                     borderWidth: 0
                 },
                 borderDistance: 0
             }
         },{
             type: 'pie',
             radius: ['65%', '80%'],
             center: ['35%','50%'],
             color: ['#c487ee', '#deb140','#49dff0', '#034079', '#6f81da', '#00ffb4'],
             hoverAnimation: true, 设置饼图默认的展开样式
             label: {
                 show: false
             },
             labelLine: {
                 normal: {
                     show: false
                 }
             },
             itemStyle: {
                 normal: {
                     borderWidth: 2,
                     borderColor: '#fff',
                 },
                 emphasis: {
                     borderWidth: 0,
                     shadowBlur: 2,
                     shadowOffsetX: 0,
                     shadowColor: 'rgba(0, 0, 0, 0.5)'
                 }
             },
             data: arr[2]
         }
     ]
 }
 
 this.setState({
     piegraph:piegraph
 })
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值