我有一个名为 “轨道” 表,它看起来像这样:获取统计数据,并显示在图表 - PHP/HighCharts
- ID,
- 名,
- 网址
- 命中
我有一个饼图,从highcharts,代码如下所示:
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'chart',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: 'Where users came from, total'
},
tooltip: {
formatter: function() {
return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true
}
},
credits: {
enabled: false
},
series: [{
type: 'pie',
name: 'Browser share',
data: [
['Firefox.com', 45.0],
['Default.com', 26.8],
['MSN', 12.8],
['Google.com', 8.5],
['Yahoo.com', 6.2],
['Others', 0.7]
]
}]
});
});
我的问题是,我怎样才能从“轨道”表(点击),以及(名称)和饼图像其输出数据:
“名”,“点击”
然后,最后将#个匹配转换为%。
您是否打算重新绘制图表,生成一次(在页面加载时)就足够了? – roselan
是的,就够了。 –