var chart;
$(document).ready(function () {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: '图表'
},
tooltip: {
formatter: function () {
return '<b>' + this.point.name + '</b>: ' + this.y + ' %';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
color: '#000000',
connectorColor: '#000000',
formatter: function () {
return '<b>' + this.point.name + '</b>: ' + this.y + ' %';
}
}
}
},
series: [{
type: 'pie',
name: 'Browser share',
// data: [['测试', 33],['测试赛', 33]]
date:Json/piedata
}]
});
});
后台
Json = L JSONSerializer.DtToJSON(dt); //js格式
piedata = " [['测试', 33],['tets', 33]]";
为什么 我把里面的 data数据源 改为后台返回的值 ,那饼图就显示不出来呢??? 望大神讲解。
$(document).ready(function () {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: '图表'
},
tooltip: {
formatter: function () {
return '<b>' + this.point.name + '</b>: ' + this.y + ' %';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
color: '#000000',
connectorColor: '#000000',
formatter: function () {
return '<b>' + this.point.name + '</b>: ' + this.y + ' %';
}
}
}
},
series: [{
type: 'pie',
name: 'Browser share',
// data: [['测试', 33],['测试赛', 33]]
date:Json/piedata
}]
});
});
后台
Json = L JSONSerializer.DtToJSON(dt); //js格式
piedata = " [['测试', 33],['tets', 33]]";
为什么 我把里面的 data数据源 改为后台返回的值 ,那饼图就显示不出来呢??? 望大神讲解。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货