My Scatter chart is saying that RGraph.CreateUID is not a function

« 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 Mimi on 15th November 2012
I'm getting this error when I try to do a scatter plot using RGraph. I've copied in commons.core etc.: (Sorry - there are no code tags)

<script src='<c:url value="/resources/js/RGraph.common.core.js" />' type="text/javascript" charset="utf-8"></script>
<script src='<c:url value="/resources/js/RGraph.common.tooltips.js" />' type="text/javascript" charset="utf-8"></script>
<script src='<c:url value="/resources/js/RGraph.scatter.js" />' type="text/javascript" charset="utf-8"></script>

This is my canvas area:

<div id='graph-crm-scattergram'>
     <canvas id="scattergram" width="500" height="500">[No canvas support]</canvas>

And this is my JavaScript code:

normalData = $.parseJSON(str);
var scatter = new RGraph.Scatter('scattergram', normalData);
scatter.Set('chart.tickmarks', 'circle');
scatter.Set('chart.xaxispos', 'center');

I'm just not sure what's going wrong. I seem to have done everything, but something must be missing.
Posted by RGraph support on 15th November 2012

That error would suggest that you haven't included the core library. Maybe the path is wrong. Check with view-source in your browser. The tag should look something like this (the path may need changing):

<script src="/resources/js/RGraph.common.core.js" ></script>

I see that you're using single quotes - try changing these to double quotes.
Posted by Mistoss on 20th May 2013
I try to define the chart labels in other language such as

bar.Set('chart.labels', ['&#3617;.&#3588;.', '&#3585;.&#3614;.']);

'&#3617;.&#3588;.' and '&#3585;.&#3614;.' are Thai Language.
But the output seem to be not encoding (look like not UTF-8).

My html file is already set to "UTF-8" charset.
Please advise any solution. Thank you.
Posted by RGraph support on 21st May 2013
Hi there,

By the looks of it you're using HTML entities - canvas is not HTML. So try using the actual characters instead. You may also need to change the pages character set.

Richard, RGraph Support

Add a reply

« Back to message list