You must be logged in to post your query.
Home › Forums › Chart Support › Doughnut not show all labels
Tagged: Doughnut
I have example doughnut chart and it’s not working show all labels
<!DOCTYPE HTML> <html> <head> <script type="text/javascript"> window.onload = function () { var chart = new CanvasJS.Chart("chartContainer", { title:{ text: "indexLabel wrap in doughnut", fontSize: 20, }, animationEnabled: true, data: [ { type: "doughnut", startAngle: 270, innerRadius: 80, indexLabel: " #percent %", indexLabelFontColor : "black", indexLabelPlacement: "outside", indexLabelWrap: true , dataPoints: [ { y: 280, label : "some label" }, { y: 148,label : "other label" }, { y: 16, label : "some other label"}, { y: 32, label : "label" } , { y: 12, label : "label" } ] } ] }); chart.render(); } </script> <script type="text/javascript" src="https://canvasjs.com/assets/script/canvasjs.min.js"></script> </head> <body> <div id="chartContainer" style="height: 460px; width: 460px"></div> </body> </html>
@nguoikhivohinh,
In the above code snippet, indexLabels are skipped when there is limited space available for the indexLabels to display or when they get too close to other indexLabels (to avoid overlapping) – this behavior is by design. By changing startAngle by few values, it’s possible to display more indexLabels. Please take a look at this updated JSFiddle.
___________ Indranil Deo, Team CanvasJS
You must be logged in to reply to this topic. Login/Register