1

在此处输入图像描述

这是地图。我希望​​它描述两个不同的数据。用面积描述阶数,用角度描述阶数。现在我知道 type = "pie" 和 roseType = true 可以画夜莺了。但数据只能是一个,面积和角度是相同的百分比。帮我 !谢谢!(原谅我扯英语。Ծ‸ Ծ)

<style>

    .data-bac{box-shadow: 1px 2px 5px #333;border-radius: 8px;background-color: #fff;}
    .data-img{width:700px;height: 482px;float:left;margin-bottom:20px;}
</style>
<div class='data-img data-bac' id='data-img'></div>
<script>
    var app = echarts.init(document.getElementById('data-img'));
    app.title = '嵌套环形图';
    var sum = [1200,1300,1400,1500] //here is the total money of area ,symbol for 苏州,常州,上海,无锡
    var option = {
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b}: {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            right:"8%",
            bottom:"8%",
            data: ["苏州","常州","无锡","上海"]
        },
        color:['#006699', '#00CC33','#000','#006600'],
        series: [{
            name:'注册用户数量的渠道分布',
            type:'pie',
            radius: ['30%', '55%'],
            roseType : true,
            data: [{
                value: 10,//here is the num of area
                name: '苏州'
            },{
                value: 20,//here is the num of area
                name: '常州'
            },{
                value: 30,//here is the num of area
                name: '无锡'
            },{
                value: 40,//here is the num of area
                name: '上海'
            }],
        }],
        backgroundColor:{color:"rgb(255,255,255)"}
    };
    // 使用刚指定的配置项和数据显示图表。
    app.setOption(option);

</script>
4

1 回答 1

1

我在同样的事情上苦苦挣扎,联系了 GitHub 上的开发人员,并被告知使用 ECharts 是不可能的;它根本不是那样设计的。

您必须在 和 之间进行roseType: 'area'选择roseType: 'radius'

roseType 文档

于 2017-07-25T12:25:29.000 回答