Jquery图表突然停止显示
我有以下代码,它在我的 Drupal Webform 的确认页面上创建一个图表(我创建了一个压力测试),并且已经运行良好数周了。现在突然间这完全停止工作了。
http://www.beatinganger.com/node/353/done?sid=720
有人知道它为什么停止工作,以及如何让它再次工作吗?我没有对代码进行任何更改。我一直在撕扯我的头发。
jQuery(function($) {
var ticks = [], vals = [];
var one = $('#edit-submitted-physical-state, #edit-submitted-mental-state, #edit-submitted-feelings-of-belonging, #edit-submitted-feelings-of-justice, #edit-submitted-feelings-of-integrity, #edit-submitted-weight-management, #edit-submitted-emotional-ease, #edit-submitted-feelings-of-stimulation, #edit-submitted-feelings-of-justice, #edit-submitted-feelings-of-relationship, #edit-submitted-feelings-of-satisfaction')
.each(function(i, el) {
vals.push(Number(el.value));
ticks.push($('label[for="'+el.id+'"]').text().replace('Feelings of ', '').replace(': ', '').replace(' State', '').replace(' Ease', '').replace(' Management', '').replace(' Control', ''));
});
var plot1 = $.jqplot('chart1', [vals], {
seriesDefaults: {
renderer: $.jqplot.BarRenderer
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
},
yaxis: {
min: 0,
max: 20,
}
}
});
});
在我的头部部分我有以下内容
<script language="javascript" type="text/javascript" src="http://www.beatinganger.com/scripts/jquery.jqplot.js"></script>
<script language="javascript" type="text/javascript" src="http://www.beatinganger.com/scripts/jqplot.barRenderer.js"></script>
<script language="javascript" type="text/javascript" src="http://www.beatinganger.com/scripts/jqplot.categoryAxisRenderer.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.beatinganger.com/scripts/jquery.jqplot.css" />
I have the following code, which was creating a graph on the confirmation page of my Drupal Webform (I created a stress test), and has been working fine for several weeks. Now all of a sudden this entirely just stopped working.
http://www.beatinganger.com/node/353/done?sid=720
Anyone have any ideas why it stopped working, and how to get it working again? I didn't make any changes to the code. I have been tearing my hair out.
jQuery(function($) {
var ticks = [], vals = [];
var one = $('#edit-submitted-physical-state, #edit-submitted-mental-state, #edit-submitted-feelings-of-belonging, #edit-submitted-feelings-of-justice, #edit-submitted-feelings-of-integrity, #edit-submitted-weight-management, #edit-submitted-emotional-ease, #edit-submitted-feelings-of-stimulation, #edit-submitted-feelings-of-justice, #edit-submitted-feelings-of-relationship, #edit-submitted-feelings-of-satisfaction')
.each(function(i, el) {
vals.push(Number(el.value));
ticks.push($('label[for="'+el.id+'"]').text().replace('Feelings of ', '').replace(': ', '').replace(' State', '').replace(' Ease', '').replace(' Management', '').replace(' Control', ''));
});
var plot1 = $.jqplot('chart1', [vals], {
seriesDefaults: {
renderer: $.jqplot.BarRenderer
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
},
yaxis: {
min: 0,
max: 20,
}
}
});
});
In my head section I have the following
<script language="javascript" type="text/javascript" src="http://www.beatinganger.com/scripts/jquery.jqplot.js"></script>
<script language="javascript" type="text/javascript" src="http://www.beatinganger.com/scripts/jqplot.barRenderer.js"></script>
<script language="javascript" type="text/javascript" src="http://www.beatinganger.com/scripts/jqplot.categoryAxisRenderer.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.beatinganger.com/scripts/jquery.jqplot.css" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
jqPlot 需要一个 ID,但您在页面上使用了一个类。尝试将其更改为 id="chart1"
jqPlot is expecting an ID, but you're using a class on your page. Try changing it to id="chart1"
知道了。可能是服务器已关闭或文件已被移动。因此,从该服务器保存 .js 文件,然后从本地目录使用它。
Got it. May be that server is down or file have been moved. So, save .js file from that server and then use it from local directory.