【发布时间】:2014-12-17 04:18:20
【问题描述】:
我在 SpringMVC 项目中开发了一个带有一些图表的仪表板。我使用HighCharts 开发图表。
基本上我检查了他们的文档以使用 AJAX + SpringMVC 创建此图表,但我做不到。所以基本上我已经通过ajax请求获取数据并在jsp中创建隐藏表并从该表中检索数据并生成图表。但我想知道如何通过 AJAX 请求直接检索这些数据。
这是我当前的代码
function chartGeneration(chart_source){
$('#chart-space').html("");
var chartsource = chart_source;
$('#chart-space').highcharts(
{
data : {
table : document.getElementById(chartsource)
},
chart : {
type : 'pie'
},
title : {
text : ''
},
yAxis : {
allowDecimals : false,
title : {
text : 'Transactions'
}
},
tooltip : {
formatter : function() {
return '<b>' + this.series.name
+ '</b><br/>' + this.point.y + ' '
+ this.point.name.toLowerCase();
}
}
});
}
【问题讨论】:
标签: jquery ajax spring-mvc charts highcharts