markdown amCharts V4:可变半径饼图

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown amCharts V4:可变半径饼图相关的知识,希望对你有一定的参考价值。

@import url("https://fonts.googleapis.com/css?family=Archivo+Narrow");

body {
  font-family: "Archivo Narrow";
}
#chartdiv {
  width: 100%;
  height: 98vh;
}
/**
 * --------------------------------------------------------
 * This demo was created using amCharts V4 preview release.
 *
 * V4 is the latest installement in amCharts data viz
 * library family, to be released in the first half of
 * 2018.
 *
 * For more information and documentation visit:
 * https://www.amcharts.com/docs/v4/
 * --------------------------------------------------------
 */
amcharts4.ready(function() {
  amcharts4.useTheme(amcharts4.themes.animated);
  var chart = amcharts4.create("chartdiv", amcharts4.pie.PieChart);
  chart.data = [
    {
      country: "Lithuania",
      value: 260
    },
    {
      country: "Czech Republic",
      value: 230
    },
    {
      country: "Ireland",
      value: 200
    },
    {
      country: "Germany",
      value: 165
    },
    {
      country: "Australia",
      value: 139
    },
    {
      country: "Austria",
      value: 128
    }
  ];

  var series = chart.series.push(new amcharts4.pie.PieSeries());
  series.dataFields.value = "value";
  series.dataFields.radiusValue = "value";
  series.dataFields.category = "country";
  series.slices.template.cornerRadius = 6;
  series.colors.step = 3;

  chart.legend = new amcharts4.pie.Legend();
});
<script src="https://www.amcharts.com/lib/4/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/4/pie.js"></script>
<script src="https://www.amcharts.com/lib/4/themes/animated.js"></script>
<div id="chartdiv"></div>
amCharts V4:  Variable radius pie chart
---------------------------------------


A [Pen](https://codepen.io/harunpehlivan/pen/KoEyyN) by [HARUN PEHLİVAN](https://codepen.io/harunpehlivan) on [CodePen](https://codepen.io).

[License](https://codepen.io/harunpehlivan/pen/KoEyyN/license).

以上是关于markdown amCharts V4:可变半径饼图的主要内容,如果未能解决你的问题,请参考以下文章

markdown amCharts V4:堆积柱形图

markdown amCharts V4:嵌套饼图

markdown amCharts V4:垂直Sankey图

markdown amCharts V4:雷达时间线图

markdown amCharts V4:雷达时间线图

markdown amCharts V4:热图圆圈