0
以下是用於生成餅圖的功能。一切工作正常,除了addLabel參數。如何在amCharts中添加標籤到餅圖?
graphSentiChart:function(graphData) {
if(graphData.length < 1){
$('.dataContentStatsPie').html('No data available')
}
// $(".dataContentAllPie").empty();
var piechart = AmCharts.makeChart("chartPie", {
"type": "pie",
"theme": "light",
"autoMargins": true,
"marginTop": 0,
"marginBottom": 10,
"marginLeft": 0,
"marginRight": 0,
"dataProvider": graphData,
"titleField":"key",
"valueField": "value",
"addLabel": (0, 25, 'Total Tweets= 360'),
"startDuration":0,
"responsive": {
"enabled":true
},
"legend":{
"autoMargins":false,
"marginLeft":20,
"enabled": true,
"spacing":20,
"markerType":"circle",
"horizontalGap" :20,
},
"labelsEnabled":false,
//"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
"colorField": "color",
"innerRadius": "60%",
"export": {
"enabled": true,
"libs": {
"path": "http://amcharts.com/lib/3/plugins/export/libs/"
}
}
});
我在addLabel參數中給出的內容沒有被採用,標籤也沒有顯示出來。有人可以幫助我嗎?
感謝。 allLabels工作正常。 我從amChart文檔[這裏](https://docs.amcharts.com/javascriptcharts/AmChart#addLabel)閱讀了關於addLabel的內容 我正在閱讀amCharts版本2的文檔。 –
不用擔心。我很高興它現在正在工作。 – martynasma