Search code examples
jchartfx

Gallery is not defined


I'm getting the above error message trying the 'Getting started' tutorial for jChartFX. In my page, all I've got is this (and it's in the same folder as the extracted jchartfx files/folders):

<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.

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.

EDIT: I've just downloaded the previous version and still get exactly the same problem

Thanks


Solution

  • 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);