
这是一张地图,我想让它描述两个不同的数据。用面积来描述订单的总数,用角度来描述订单的数量。现在我知道type = "pie“和roseType = true可以绘制Nightingale。但是数据只能是一个,面积和角度是相同的百分比。救救我!谢谢!(请原谅我的拖后腿。Ծ‸Ծ)
<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>发布于 2017-07-25 20:25:29
我正在为同样的事情而苦苦挣扎,我联系了GitHub上的开发人员,他们告诉我这在ECharts上是不可能的;它根本就不是这样设计的。
你必须在roseType: 'area'和roseType: 'radius'之间做出选择。
https://stackoverflow.com/questions/44942385
复制相似问题