highcharts 怎么从后台获得数据?
<script type="text/javascript">
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'bar'
},
title: {
text: 'Historic World Population by Region'
},
subtitle: {
text: 'Source: Wikipedia.org'
},
xAxis: {
categories: <%= xAxisCategories %>,//从后台获取数据
tickPixelInterval:0.2,
title: {
text: null
}
},
yAxis: {
min: 0,
title: { // 单位
text: 'Population (millions)',
align: 'high'
},
labels: {
overflow: 'justify'
}
},
tooltip: { //鼠标放上去的提示
formatter: function() {
return ''+
this.series.name +': '+ this.y +' millions';
}
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
}
},
legend: {
layout: 'vertical',//垂直
align: 'right',
verticalAlign: 'top',
x: -100,
y: 100,
floating: true,
borderWidth: 1,
backgroundColor: '#FFFFFF',
shadow: true
},
credits: {
enabled: false
},
series: <%= returnValue %> //此处数据从后台获取
});
});
});
</script>
</head>
<body>
<div id="container" style="width: 700px; height: <%=containerHeight%>; margin: 0 2em"></div>
这是我的前台代码,后台要怎么样编?加入我想显示paper表里的author和artical_num,肿么弄啊。。
highcharts Asp.net
[解决办法]
我也用highchart 后台 静态变量 returnValue 然后用string 按照前台显示的格式 拼接即可。 网上应该有例子。如果你还有问题。我可以把我的源代码发给你看。