简体   繁体   English

画廊没有定义

[英]Gallery is not defined

I'm getting the above error message trying the 'Getting started' tutorial for jChartFX. 我正在尝试jChartFX的“入门”教程时收到上述错误消息。 In my page, all I've got is this (and it's in the same folder as the extracted jchartfx files/folders): 在我的页面中,我所拥有的就是这个(它与提取的jchartfx文件/文件夹位于同一文件夹中):

<head>
    <link rel="stylesheet" type="text/css" href="styles/chartfx.css" />
    <script type="text/javascript" src="js/jchartfx.system.js"></script>
    <script type="text/javascript" src="js/jchartfx.coreBasic.js"></script>
</head>
<body onload="loadChart()">

    <script type="text/javascript" language="javascript">
         var chart1;
         function loadChart()
         {
              chart1 = new cfx.Chart();
              chart1.setGallery(Gallery.Pie);
              var divHolder = document.getElementById('ChartDiv');
              chart1.create(divHolder);
         }
    </script>

    <div id="ChartDiv" style="width:600px;height:400px;display:inline-block"></div>
</body>

I think Gallery is defined in jchartfx.coreVector.js, and I know the link to the Javascript file is correct because I added an extra function to it (sayHello()) and I can call that function fine. 我认为Gallery是在jchartfx.coreVector.js中定义的,并且我知道到Javascript文件的链接是正确的,因为我向它添加了一个额外的函数(sayHello()),并且可以很好地调用该函数。

Can anyone tell me why I'm getting this error? 谁能告诉我为什么我会收到此错误? The js is all minified so it's hard for me to work out what's going wrong. js都被缩小了,所以对我来说很难找出问题所在。

EDIT : I've just downloaded the previous version and still get exactly the same problem 编辑 :我刚刚下载了以前的版本,但仍然遇到完全相同的问题

Thanks 谢谢

Fixed it. 修复。 There seems to be a typo in the 'Getting Started' guide on their website. 他们网站上的“入门”指南中似乎有一个错字。

chart1.setGallery(Gallery.Pie);

Should read 应该读

chart1.setGallery(cfx.Gallery.Pie);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM