Jquery图表突然停止显示

发布于 2024-10-24 18:41:07 字数 2008 浏览 1 评论 0原文

我有以下代码,它在我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

毅然前行 2024-10-31 18:41:07

jqPlot 需要一个 ID,但您在页面上使用了一个类。尝试将其更改为 id="chart1"

jqPlot is expecting an ID, but you're using a class on your page. Try changing it to id="chart1"

万劫不复 2024-10-31 18:41:07

知道了。可能是服务器已关闭或文件已被移动。因此,从该服务器保存 .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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文