javascript - 图表 : How can I use it to draw a Nightingale with describe two data?

标签 javascript echarts

enter image description here

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

<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>

最佳答案

我也遇到了同样的问题,联系了 GitHub 上的开发人员,并被告知 ECharts 无法做到这一点;它根本不是那样设计的。

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

Documentation on roseType

关于javascript - 图表 : How can I use it to draw a Nightingale with describe two data?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44942385/

相关文章:

javascript - Javascript 中的对象与数组就像 Python 的字典与列表?

javascript - 使用 PHP cURL 的 X-Insta-Forwarded-For 错误 Instagram API

javascript - Echarts,如何使用数据系列切换线条颜色

javascript - 将 Angular ECharts 导入 Stackblitz 15.1 项目?

Javascript 更改按钮和 onClick 问题

javascript - 在引用父页面中的 anchor 的 iframe 内链接?

javascript - 使用 JavaScript 将字符串转换为标题大小写

javascript - 隐藏 <div> onload 并显示点击事件无法正常工作

javascript - echarts:如何在条形图上添加正态分布曲线?

javascript - 如何在 Apache echart 中获得网格的通用工具提示?