我在使用带有 JSF 的 jqPlot 时遇到问题
我将此代码添加到我的 JSF 页面:
$(document).ready(function () {
var s1 = [200, 600, 700, 1000];
var s2 = [460, - 210, 690, 820];
var s3 = [-260, - 440, 320, 200];
var ticks = ['May', 'June', 'July', 'August'];
var plot1 = $.jqplot('chart1', [s1, s2, s3], {
// The "seriesDefaults" option is an options object that will
// be applied to all series in the chart.
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
fillToZero: true
}
},
series: [{
label: 'Hotel'
}, {
label: 'Event Regristration'
}, {
label: 'Airfare'
}],
legend: {
show: true,
placement: 'outsideGrid'
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
},
yaxis: {
pad: 1.05,
tickOptions: {
formatString: '$%d'
}
}
}
});
});
但是当我尝试加载页面时出现此错误:
Uncaught TypeError: Cannot read property 'BarRenderer' of undefined
(anonymous function)portfolioModeling.xhtml:184
f.extend._Deferred.e.resolveWithjquery.min.js:2
e.extend.readyjquery.min.js:2
c.addEventListener.C
我添加了整个所需的 js 文件和 css 文件,但我迷路了,不知道问题出在哪里
提前致谢