问题
This is my code snippet... there is three pie slices in pie chart, but only two labels are visible
var options = {
is3D: true,
fontSize: 7,
backgroundColor: 'transparent',
legend: 'none',
pieSliceText: 'value',
pieSliceTextStyle: { bold: true, color:'black'},
tooltip: {
textStyle: { fontSize: 12 }
},
slices: {
0: {color: '#e76442'},
1:{color: '#ffc100'},
2:{color: '#348be7'},
}
};
回答1:
Because there is no data shown my assumption is that the 3rd value is too small so there is no place for it. It is not rendered at all.
One option is to rotate pie chart so missing value get more width to be displayed. For example adding option:
pieStartAngle: 90
See also example Rotating a Pie Chart from google docs. On the left chart word 'Italian' is not visible. On the right chart it is visible after rotation.
Otherwise I don't see option to get it visible.
来源:https://stackoverflow.com/questions/21929851/pieslice-label-is-not-visible-in-google-pie-chart-if-its-proportion-is-small-ca