87,909
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript" src="./scripts/jquery.js"></script>
<script type="text/javascript" src="./scripts/jquery.jqplot.js"></script>
<script type="text/javascript" src="./scripts/jqplot.barRenderer.js"></script>
<script type="text/javascript" src="./scripts/jqplot.categoryAxisRenderer.js"></script>
<script type="text/javascript" src="./scripts/jqplot.pointLabels.js"></script>
<script type="text/javascript" src="./scripts/excanvas.js"></script>
var tshowType;
var tcustomerType;
var auth;
var tuserid;
$(document).ready(function(){
auth = $("#loginAuthority").val();
tuserid= $("#userID").val();
growthTable();
});
function growthTable() {
if (tshowType == null) {
tshowType = "1";
}
if (auth == "0"){
if (tcustomerType == null) {
tcustomerType = "1000";
}
}else{
tcustomerType = tuserid;
}
$.ajax({
type : "post", //提交的类型
url : "./growthTableJsonAction", //提交地址
dataType : 'json',//参数
data : {"showType" :tshowType,"customerType":tcustomerType},
success : function(data) {
var acceptNumber = new Array(); //受理人数
var bareMetalNumber = new Array(); //件数
var marketingDate = new Array(); //横坐标
$.each(data, function(i, val) {
marketingDate.push(data[i].marketingDate+"月");
acceptNumber.push(data[i].acceptNumber);
bareMetalNumber.push(data[i].bareMetalNumber);
});
$("#chart2").empty();
var plot = $.jqplot('chart2',
[ acceptNumber, bareMetalNumber ], {
seriesDefaults : {
renderer :$.jqplot.BarRenderer, //使用柱状图表示
pointLabels : {
show : true
},
rendererOptions : {
barMargin : 10
}
},
series : [ {
label : '受理人数'
}, {
label : '件数'
} ], //分类名
legend : {
show : true,//分类名称框
},
axesDefaults: {
show:true
},
axes : {
xaxis : {
ticks : marketingDate,//x轴绘制方式
renderer : $.jqplot.CategoryAxisRenderer
},
yaxis : {
tickOptions : {
formatString : '%d',// 设置坐标轴上刻度值显示格式
showMark : true, //是否显示刻度
showGridLine : true,
show : true,
showGridline : true,
},
showTicks : true
}
}
}
);
}
});
}