I have a problem with the key on my chart

« 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/demos/index.html#donut, 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>
         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']);

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\" >

Everything works perfectly.

Posted by RGraph support on 8th February 2013

You have a typo:

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

Posted by JES on 8th February 2013

Thank you so much for solving my ineptitude!

Add a reply

« Back to message list