Getting an error: Cannot read property 'translate' of null

Share RGraph:   Share or Like RGraph on Facebook!

« 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 Ryan on 21st September 2016
I seem to be experiencing an issue where "Uncaught TypeError: Cannot read property 'translate' of null" occurs. Has anyone found a reason maybe? I have just copied the code from the example and added the libraries. I would really appreciate some help on this.

Thanks in advance!
Posted by Richard on 21st September 2016
Hi there,

Sounds like you're using the wrong ID. It should match the ID that's used by the canvas.

Eg.

<canvas id="myCanvas" width="600" height="250"></canvas>

The ID there would be: myCanvas


Richard
Posted by Ryan on 21st September 2016
Ah silly me I was just using a straight div with an Id, thank you so much. The thermometer appears to be quite massive with out any width or height, is this normal?
Posted by Richard on 21st September 2016
Hi there,

Depends on your canvas size. It typically should be roughly 100 wide x 400 height like the example:

www.rgraph.net/demos/thermometer-basic.html

Note that you can use the gutter settings if you need a larger canvas and also that the thermometer sizing has been rewritten for the next release.



Richard
Posted by Lisa on 21st December 2016
I am getting this error simply by opening your demo in notepad++ to edit. Even if I don't change anything, it will create this error. What is the incompatibility with notepad++ ?
Posted by Richard on 21st December 2016
Hi there,

It sounds like it's trying to display it - maybe notepad++ doesn't fully support either canvas or SVG. You could try turning off the notepad++ preview if it has one. Use a browser to see the charts.




Richard
Posted by Lisa on 22nd December 2016
I was trying to view it in IE after the edit. I did find that I could then view it in Firefox, just not IE (after the edit), displayed fine in IE before opening in notepad++. I tried creating one from scratch in regular notepad, but I have the same issue, only works in Firefox. There must be something about your demos that force it to work in IE that gets lost. Well sorry to say I am going to have to find a different solution. Love the graph options though:(
Posted by Follow-up on my issue with IE on 6th January 2017
It turns out that we had compatibility view set for our site in IE and that appears to have been the issue.

Add a reply




« Back to message list