简体   繁体   English

如何使用amcharts创建多环甜甜圈饼图?

[英]How to create multi ring donut pie chart using amcharts?

I want to make multi ring donut pie chart using AMCharts. 我想使用AMCharts制作多环甜甜圈饼图。 Example: 例:

在此处输入图片说明

I'd say to make this kind of chart you're better off with a Gauge chart type where you can define separate bands like in your example. 我想说,使用Gauge图表类型可以使这种图表更好,您可以像示例中那样定义单独的波段

Here's a working code: 这是一个工作代码:

 var gaugeChart = AmCharts.makeChart("chartdiv", { "type": "gauge", "axes": [{ "axisAlpha": 0, "tickAlpha": 0, "labelsEnabled": false, "startAngle": -150, "endAngle": 150, "bands": [{ "color": "#8da44c", "endValue": 50, "startValue": 0, "radius": "100%", "innerRadius": "95%", "balloonText": "Lime one" }, { "color": "#ce0004", "endValue": 30, "startValue": 0, "radius": "90%", "innerRadius": "85%", "balloonText": "Red one" }], "endValue": 100 }], "allLabels": [{ "text": "3,000", "align": "center", "y": "45%", "size": 35 }] }); 
 <script src="http://www.amcharts.com/lib/3/amcharts.js"></script> <script src="http://www.amcharts.com/lib/3/gauge.js"></script> <div id="chartdiv" style="width: 100%; height: 300px;"></div> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM