遍历数据格式
$.each(ajDataNew, function(key, val) {
yset.push( val.thickmin);
name = val.station;
xset.push([val.inspectingdate +'/'+val.inspectingunit]) ;//为x轴数组赋值
growth += val.thickmin + ",";
data.push({
x: xset,
y: yset
});
});
通过ajax跳转页面传参
String idd=request.getParameter("date");
String ids=request.getParameter("station");
前台jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="${ctx}/js/jquery-2.0.2.min.js" type="text/javascript"></script>
<script src=" ${ctx}/js/highcharts.js"></script>
<script src=" ${ctx}/js/Highcharts-3.0.2/modules/data.js"></script>
<script>
</script>
<script type="text/javascript">
<%
String idd=request.getParameter("date");
String ids=request.getParameter("station");
%>
document.title='001';
var chart;
var name=null;
var ajDataNew=null;
$(function () {
//统计图树
$.post('/pipe/tbYbPipethick/tbYbPipethickAction!photos?pipeno=<%=idd%>'+'&station=<%=ids%>', function (data) {
ajDataNew = $.parseJSON(data);//data json格式
console.log("newJsp data:"+ajDataNew);//[object Object]格式
lo();
});
});
function lo(){
var x