首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jqplot piecharts错误问题

jqplot piecharts错误问题
EN

Stack Overflow用户
提问于 2014-08-11 18:57:07
回答 1查看 192关注 0票数 0

我正在使用jqplot来制作饼图,我已经使用了jqplot文档中给出的示例代码,但我得到了一些错误,如e.jqplot is undefined,我的代码如下

代码语言:javascript
复制
      <script src="jquery-2.0.3.js"></script>


<script type="text/javascript" src='jquery.jqplot.js'></script>
<script type="text/javascript" src="jqplot.pieRenderer.min.js"></script>
<script type="text/javascript" src="jqplot.donutRenderer.min.js"></script>

    <script>
    $(document).ready(function(){
      var data = [
        ['Heavy Industry', 12],['Retail', 9], ['Light Industry', 14],
        ['Out of home', 16],['Commuting', 7], ['Orientation', 9]
      ];
      var plot1 = jQuery.jqplot ('weeklyProjectSummary', [data],
        {
          seriesDefaults: {
            // Make this a pie chart.
            renderer: jQuery.jqplot.PieRenderer,
            rendererOptions: {
              // Put data labels on the pie slices.
              // By default, labels show the percentage of the slice.
              showDataLabels: true
            }
          },
          //legend: { show:true, location: 'e' }
        }
      );
    });
    </script>


    <div id="weeklyProjectSummary"></div>
EN

回答 1

Stack Overflow用户

发布于 2014-08-11 20:54:10

您可能会收到此错误,因为您没有正确包含jqplot文件。

确保已复制代码文件夹中的jquery.jqplot.jsjqplot.pieRenderer.min.jsjqplot.donutRenderer.min.js

根据我的说法,您已经复制了文件夹中的jquery.jqplot.min.js文件。并且您在HTML代码中包含了jquery.jqplot.js文件

检查一次。如果您已经复制粘贴了文件夹中的缩小文件(.min),则在html <script>标记中更正它。

更改为:<script type="text/javascript" src='jquery.jqplot.min.js'></script> (添加'.min')

致以敬意,

阿尼什

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25241612

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档