Hi there — I have a pie chart with the labels inside the slices, and for some reason one of the labels is not showing.
At first, the light blue slice and the purple slice both were blank, and I assumed this was because the label was too big/the slice was too small. However, after increasing the chart size, now the purple one with 1 entry is showing but the light blue one with 1 entry is not, even though they are the exact same size.
The code:
$.ajax({
type: "POST",
url: "[url.php]",
dataType: "JSON",
cache: false,
data: piedata,
success: function(data) {
var chart = new CanvasJS.Chart("chartcontainer", {
title: {
text: pieheader
},
exportEnabled: true,
height: 500,
width: 900,
legend: {
verticalAlign: "center",
horizontalAlign: "left",
fontSize: 15,
fontFamily: "arial"
},
data: [
{
type: "pie",
percentFormatString: "#0",
toolTipContent: "{legendText}",
showInLegend: true,
indexLabelPlacement: "inside",
indexLabelFontColor: "#ffffff",
indexLabelFontSize: 15,
indexLabelMaxWidth: 53,
indexLabel: "{y} (#percent%)",
dataPoints: data
}
]
});
chart.render();
}
Any ideas on why one isn’t showing up and the other one is? I’d really like to not have to make the chart even larger, since it does appear that the label should show up at that size…
-
This topic was modified 8 years, 2 months ago by Emily T.