Jquery的jqplot插件问题。

Quree_Y 2015-01-16 11:36:14
jqplot绘制柱形图表
出现$.jqplot没有定义, 求解决。
代码如下:
导入的js文件。
<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>

js代码:
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
}
}
}
);
}
});
}


其中line36,39,61 TypeError: $.jqplot is undefined
$.jqplot 未定义,但是,在脚本中能定位到jquery.jqplot.js文件中$.jqplot着function。
...全文
93 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

87,909

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧