ECharts边框阴影圆环

好早以前写的一个demo了,ECharts Gallery停运了,搬到博客上来。
在这里插入图片描述

option = {
    title: {
        text: '80%',
        x: 'center',
        y: '41.5%',
        zlevel: 3, //层级
        textStyle: {
            fontWeight: '700',
            color: '#303030',
            fontSize: '60'
        }
    },
    legend: {
        show: true,
        itemGap: 12,
        bottom: 0,
        itemWidth: 14,
        data: ['得分占比', '未得分占比']
    },

    series: [
        // 内圆
        {
            type: 'pie',
            zlevel: 2, //层级
            radius: ['0', '40%'],
            center: ['50%', '45%'],
            itemStyle: {
                normal: {
                    shadowBlur: 10,
                    shadowColor: 'rgba(0,0,0,.3)',
                    color: '#fff',
                    label: {
                        show: false
                    },
                    labelLine: {
                        show: false
                    }
                },
            },
            hoverAnimation: false,
            data: [100],
        },
        // 占比环
        {
            type: 'pie',
            clockWise: true,
            // silent: true,
            radius: ['40%', '62%'],
            center: ['50%', '45%'],
            itemStyle: {
                normal: {
                    label: {
                        show: false
                    },
                    labelLine: {
                        show: false
                    }
                }
            },
            data: [{
                value: 80,
                name: '得分占比',
                itemStyle: {
                    normal: {
                        color: {
                            colorStops: [{
                                offset: 0,
                                color: '#2fdb9a' // 100% 处的颜色
                            }, {
                                offset: 1,
                                color: '#1cbab4' // 0% 处的颜色
                            }]
                        }
                    }
                }
            }, {
                name: '未得分占比',
                value: 20,
                itemStyle: {
                    normal: {
                        color: '#e3e3e3'
                    }, // 默认颜色
                    emphasis: {
                        color: '#e3e3e3'
                    } // hover 颜色
                }
            }]
        },
        // 外环
        {
            type: 'pie',
            radius: ['62%', '70%'],
            center: ['50%', '45%'],
            itemStyle: {
                normal: {
                    shadowBlur: 10,
                    shadowColor: 'rgba(0,0,0,.2)',
                    color: '#fff',
                    label: {
                        show: false
                    },
                    labelLine: {
                        show: false
                    }
                },
            },
            hoverAnimation: false,
            data: [100],
        },
    ]
};
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
echarts中,饼图阴影的配置可以通过设置series中的shadowBlur和shadowColor属性来实现。具体地,在你给出的代码中,可以通过在series中的第一个对象中添加以下代码来实现阴影效果: ```javascript series: [ { // 其他配置... itemStyle: { shadowBlur: 10, // 阴影模糊度 shadowColor: 'rgba(0, 0, 0, 0.5)' // 阴影颜色 }, // 其他配置... } ] ``` 在上面的代码中,shadowBlur用于设置阴影的模糊度,可以根据需要调整数值;shadowColor用于设置阴影的颜色,其中rgba(0, 0, 0, 0.5)表示黑色的半透明阴影。你可以根据自己的需求调整这些值以达到想要的阴影效果。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [echarts饼图hover时消失的问题](https://blog.csdn.net/qq_39981639/article/details/128676871)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [【Echartsecharts饼图、图配置代码详解](https://blog.csdn.net/qq_61402485/article/details/131492009)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ZionHH

落魄前端,在线炒粉

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值