CakePHP中的jqplot由于未知原因而无法呈现

时间:2013-01-25 14:48:49

标签: php html cakephp jqplot

我有一个CakePHP网站,希望动态渲染jqplots。目前我无法渲染任何东西......

在我的默认布局中,我有:

// ../layouts/default.ctp
echo $this->Html->script('jquery');
echo $this->Html->script('jquery.jqplot.min');
echo $this->Html->css('jquery.jqplot.min');

当我查看源代码时,浏览器可以使用所有这些文件(即我可以单击每个src链接并将文件拉得很好)。

在我的视图文件中:

// ..Views/Plots/index.ctp
<div id="mychart" style="height:400px;width:500px; "></div>

<script>
    $(document).ready(function(){
        $.jqplot('mychart', [[3,7,9,1,4,6,8,2,5]]);
    });
</script>

当我查看源代码时,所有内容都显示在正确的位置,即<head>部分中的脚本,并且视图很好地位于我的#content div中。我到底做错了什么?!在过去的三个小时里,我的头发一直在撕裂!

1 个答案:

答案 0 :(得分:0)

<强>固定

问题似乎与我使用的jquery版本有关。我现在正在使用jqplot(v1.6.4)中包含的jquery版本。