前端技巧:echarts中国地图外边框设置阴影投影效果------荧光效果 随笔

要想给echarts设置背景阴影,重要的是要将地图固定。

下面是源码:

option = {
    backgroundColor: '#000',//画布背景颜色
    geo: {
        show: true,
        map: 'china',
        label: {
            normal: {
                show: false
            },
            emphasis: {
                show: false,
            }
        },
        roam: false,//地图设置不可拖拽,固定的
        itemStyle: {
            normal: {
                areaColor: '#006fff',
                borderWidth: 0,
                shadowColor: 'rgba(0,54,255, 1)',
                shadowBlur: 100
            }
        }
    },
    series: [
    {
        type: 'map',
        map: 'china',
        geoIndex: 1,
        aspectScale: 0.75, //长宽比
        showLegendSymbol: false, // 存在legend时显示
        label: {
            normal: {
                show: false,
            },
            emphasis: {
                show: false,
                textStyle: {
                    color: '#fff'
                }
            }
        },
        roam: false,
        itemStyle: {
            normal: {
                areaColor: '#006fff',
                borderColor: '#0145a4',
                borderWidth: 1
            },
            emphasis: {
                areaColor: '#006fff'
            }
        },
    }]
}

下面是效果图:

发布了72 篇原创文章 · 获赞 6 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/hongyu799/article/details/81979827