Problem with chart.key

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by JES on 7th February 2013
I have been working with both the Pie and Donut charts trying to add a key like you have in the donut chart examples, www.rgraph.net/examples/donut.html, specifically the Browser share (mid 2008) donut.

Every time I try to add a Key to pie02.html included in the Jan 31 Stable download I get this error:
TypeError: 'undefined' is not a function (evaluating 'RGraph.DrawKey(this, this.properties['chart.key'], this.properties['chart.colors'])')

  The code I'm using:
   <canvas id="cvs" width="500" height="350">[No canvas support]</canvas>
     <canvas id="donut1" width="350" height="250">[No canvas support]</canvas>
    
     <script>
         window.onload = function ()
         {
             var pie = new RGraph.Pie('cvs', [4,8,4,6,5,3,2,5]);
             pie.Set('chart.tooltips', ['Alvin','Pete','Hoolio','Jack','Kev','Luis','Lou','Jesse']);
             pie.Set('chart.labels', ['Alvin','Pete','Hoolio','Jack','Kev','Luis','Lou','Jesse']);
             pie.Set('chart.key', ['1', '2', '3', '4', '5', '6', '7']);
             pie.Draw();
       
         }
     </script>

If I use the libraries included in the download as follows using this method:
     <script scr="../libraries/RGraph.common.key.js" ></script>
     <script src="../libraries/RGraph.common.core.js" ></script>
     <script src="../libraries/RGraph.common.dynamic.js" ></script>
     <script src="../libraries/RGraph.common.tooltips.js" ></script>
     <script src="../libraries/RGraph.pie.js" ></script>

  I get the above error.

If I use the libraries used in the samples on your web site using this method to get the libraries:
<script src="javascript.www.rgraph.net/libraries/combined.html/RGraph.common.core.js/RGraph.common.tooltips.js/RGraph.common.key.js/RGraph.common.dynamic.js/RGraph.common.effects.js/RGraph.pie.js\" >
     </script>

Everything works perfectly.

Posted by RGraph support on 8th February 2013
Hi,

You have a typo:

<script scr="../libraries/RGraph.common.key.js" ></script>
         ^^^

PS Could you link to the RGraph website - thanks.

Richard, RGraph Support

1 Year Premium Support now reduced to £299:
   www.rgraph.net/support
Posted by JES on 8th February 2013
Wow.

Thank you so much for solving my ineptitude!

Add a reply




« Back to message list