绑定数据源是出现下面情况,请路过的大神帮忙
获取到的json数据如下
页面显示如下
js代码如下
var chart1 = new Highcharts.Chart({
chart: {
renderTo: "container1",
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
},
title: {
text: year+'年'+month+'月防伪查询统计查询产品分布图'
},
tooltip: {
pointFormat: '<b>{point.psname}</b><br/>{series.name}: <b>{point.querycount}</b>,占: <b>{point.proportion} %</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.psname}</b><br/>查询数量: {point.querycount}',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
},
showInLegend: true
}
},
series: [{
type: 'pie',
name: '查询次数',
data: []
}]
});
$.ajaxSettings.async = false;
$.getJSON("/Charts/GetFwQureyInfo_Product?year=" + year + "&month=" + month, function (dict) {
chart1.series[0].setData(eval(dict));
});
已解决,把字段psname换成name,字段querycount换成y就会显示正常,为什么?