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

How to create multi ring donut pie chart using amcharts?

我想使用 AMCharts 制作多环甜甜圈饼图。示例:

我想说要制作这种图表,您最好使用仪表图表类型,您可以在其中定义单独的 bands,就像您的示例中那样。

这是一个工作代码:

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>