首页 新闻 会员 周边

highcharts饼图绑定数据源问题

0
悬赏园豆:20 [已解决问题] 解决于 2016-07-04 16:22

绑定数据源是出现下面情况,请路过的大神帮忙

 

获取到的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));
});

Meng_meng的主页 Meng_meng | 初学一级 | 园豆:67
提问于:2016-07-04 16:01
< >
分享
最佳答案
0

已解决,把字段psname换成name,字段querycount换成y就会显示正常,为什么?

Meng_meng | 初学一级 |园豆:67 | 2016-07-04 16:22
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册