Canvas not found in IE 11 in Line chart

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 Himanshu Luthra on 4th November 2016
I am trying to use HTML canvas in my code. but when i fetch this canvas in my js file with the code

document.getElementById(id);

this.canvas.getContext('2d');

it returns a DispHTMLUnknownElement which does not have getContext method. This works perfect in Chrome but gives issue in IE 11.

I am struggling with this issue for hours now. Please help

Regards
Posted by Richard on 4th November 2016
Hi there,

On what platform? IIRC Some of the server OS's have issues. Try a basic snippet:

<html>
<body>
<canvas id="cvs" width="300" height="250"></canvas>

<script>
     canvas = document.getElementById('cvs');
     context = canvas.getContext('2d');

     alert(context);
</script>

<body>
</html>



Richard
Posted by Himanshu Luthra on 4th November 2016
Hi Richard,

Thanks for your reply. This is working fine. Issue comes when i configure same code in TeamCity server. Teamcity server creates this HTML with data. When i try accessing the HTML page directly from Teamcity server then it gives error but if i download the teamcity pack to my local machine then it works fine.

I Hope i am able to make you understand the issue.

Regards,
Himanshu
Posted by Richard on 4th November 2016
Hi there,

Then maybe its generating invalid code whilst on the server. Can you give me the address to an example page?

Richard

Add a reply




« Back to message list