有数据时可以展示所有数据
没有数据时少了三个分局数据
$('#th_view_0_01').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
setSize:(
$(document).width(),
$(document).height()/2,
false
),
title: {
text: ''
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
}
}
},
series: [{
type: 'pie',
name: '占有率',
data: datesPer
}]
});
highcharts饼图默认会多余为0的数据隐藏掉的。