tqtiwvfdn / explorercanvas

Automatically exported from code.google.com/p/explorercanvas
Apache License 2.0
0 stars 0 forks source link

Making ZingChart library (www.zingchart.com) and its function zingchart.exec("yourChartId", "getimagedata") work out with Canvas Explorer #129

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In one project I have include both the library of 
ZingChart(www.zingchart.com) and the library of Explorer Canvas
2. To solve the problem that the function zingchart.exec("yourChartId", 
"getimagedata") does not work in Internet Explorer and it seems it does the 
same thing than toDataResult() of a canvas element;
3. But I cannot make vmlCanvasManager init the elment of the canvas because 
those elments (the canvas) are innerly created in ZingChart and managed by 
ZingChart.

What is the expected output? What do you see instead?
The output of getimagedata is a base 64 image with format JPEG or PNG. It works 
out properly with Mozilla, Google Chrome and Safari but not with Intenet 
Explorer 7 or 8. With IE it returns a blank space String.

What version of the product are you using? On what operating system?
I have downloaded the latest version of Explorer Canvas just downloaded on 
March 14th, 2013.

Please provide any additional information below.
I have tried to redefine the getContext of the class HTMLCanvasElement, default 
javascript class associate to the canvas element, prior to the creation of the 
canvas elements in the ZingChart library with some code like:

if (HTMLCanvasElement)
{
   var vGetContextOld=HTMLCanvasElement.prototype.getContext;

   HTMLCanvasElement.prototype.getContextOld = vGetContextOld;

   HTMLCanvasElement.prototype.getContext= function ()
   {
        G_vmlCanvasManager.initElement(this);
        var ctx = el.getContextOld('2d');
        return ctx;
   }   

}

but it doesn't work properly in IE as it seems that the HTMLCanvasElement class 
is not defined in IE even though in the web page the Explorer Canvas js is 
included. Have got the canvas elements of the Canvas Explorer other JavaScript 
class associated apart from HTMLCanvasElement?

Have you got any alternative or similar idea to make this work out?

Thanks in advance for any help.

Original issue reported on code.google.com by raulgh.a...@gmail.com on 18 Mar 2013 at 3:14