How to change amcharts pie themes?

前端 未结 1 1759
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 04:00

My HTML code is like this :

My Javascript code is like this :

相关标签:
1条回答
  • 2020-12-04 05:01

    You need to specify the theme option while initializing as below and also make use of makeChart directly instead of Amcharts.AmPieChart(). Your updated code would be:

    AmCharts.makeChart("chartdiv", {
      "type": "pie",
      "theme": "light",
      "dataProvider": chartData,
      "valueField": "litres",
      "titleField": "country",
      "export": {
        "enabled": true
      }
    });
    

    UPDATED FIDDLE

    0 讨论(0)
提交回复
热议问题