其他分享
首页 > 其他分享> > 236Echarts - 3D 柱状图(Global Population - Bar3D on Globe)

236Echarts - 3D 柱状图(Global Population - Bar3D on Globe)

作者:互联网

效果图

在这里插入图片描述

源代码

$.getJSON("data-gl/asset/data/population.json", function (data) {

    data = data.filter(function (dataItem) {
        return dataItem[2] > 0;
    }).map(function (dataItem) {
        return [dataItem[0], dataItem[1], Math.sqrt(dataItem[2])];
    });

    option = {
        backgroundColor: '#000',
        globe: {
            baseTexture: "data-gl/asset/world.topo.bathy.200401.jpg",
            heightTexture: "data-gl/asset/world.topo.bathy.200401.jpg",
            shading: 'lambert',
            environment: 'data-gl/asset/starfield.jpg',
            light: {
                main: {
                    intensity: 2
                }
            },
            viewControl: {
                autoRotate: false
            }
        },
        visualMap: {
            max: 40,
            calculable: true,
            realtime: false,
            inRange: {
                colorLightness: [0.2, 0.9]
            },
            textStyle: {
                color: '#fff'
            },
            controller: {
                inRange: {
                    color: 'orange'
                }
            },
            outOfRange: {
                colorAlpha: 0
            }
        },
        series: [{
            type: 'bar3D',
            coordinateSystem: 'globe',
            data: data,
            barSize: 0.6,
            minHeight: 0.2,
            silent: true,
            itemStyle: {
                color: 'orange'
            }
        }]
    };

    myChart.setOption(option);
})

标签:dataItem,color,Globe,Global,jpg,柱状图,asset,gl,data
来源: https://blog.51cto.com/u_15294985/2995609