<!-- 搜索表单 -->
...
<div id="show-statistical"></div>
<script src="/snsshop_admin/js/libs/highcharts/highcharts.js"></script>
<script src="/snsshop_admin/js/libs/highcharts/exporting.js"></script>
<script type="text/javascript" src="/snsshop_admin/js/libs/datePicker/WdatePicker.js"></script>
<
script>
var chart = new Highcharts.Chart({
chart: {
renderTo: 'show-statistical',
type: 'line',
// marginRight: 30,
// marginBottom: 25
},
title: {
text: '',
x: -20 //center
},
subtitle: {
text: '',
x: -20
},
xAxis: {
categories: [],
},
yAxis: {
title: {
text: ''
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: ''
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [{
name: '会员新增统计',
data: []
}, {
name: '会员充值统计',
data: []
}]
});
$("#select-users").submit(function(event) {
event.preventDefault();
$.post('/snsshop_admin/managers/statistical', $("#select-users").serialize(), function(data) {
// 返回一个 JSON
chart.xAxis[0].setCategories(data[0]);
chart.series[0].setData(data[1]);
chart.series[1].setData(data[2]);
},'json');
return false;
});
// 默认自动提交
$("#select-users").submit();
参考资料:
Highcharts set x-axis categories
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。