1

I am using jqPlot and all seems to work well even with IE8 using excanvas.js. When I preview the page for printing all looks good, but when I print the page, the legend shows but the charts do not. If I export the page to Adobe PDF, an area for the chart is there and the chart is visible at times until you scroll over it then it is hidden.

Any help is much appreciated.

Marc
  • 23
  • 1
  • 4
  • [Is it by any chance related to this issue?](http://stackoverflow.com/q/11291859/613495) – Boro Aug 02 '12 at 15:31
  • Unfortunately no, but I did run into that issue and the workaround worked for me as well. I am thinking this may be a print css issue. When I preview it in IE8 all looks good. When I print, all I see are the legends and a space where the canvas is. When I export it to PDF, I see the same, but when I play with color-rendering in Acrobat Reader, I briefly see the chart and then a blank canvas. I will see if a style used for printing which puts the canvas in the background will work. I will let you know how it goes. – Marc Aug 02 '12 at 20:56

1 Answers1

0

It cal be solved by using the jquery after the jqplot has been drawn

$('.jqplot-point-label').append('%');
    var imgData = $('#displaysection').jqplotToImageStr({});
    var imgElem = $('<img/>').attr('src',imgData);
    $('#displaysection').append(imgElem);
Anoop P S
  • 754
  • 1
  • 12
  • 31
  • Your solution works for me on IE 9+, but not on IE 8. I get an image placeholder, where the Image should be – Chopo87 Jul 25 '13 at 09:19
  • In case of printing you have to convert it to image before printing, One way to solve the issue is use the original jqplot file in IE 8 If it works fine it must be over issue. – Anoop P S Jul 25 '13 at 12:09
  • It turns out `canvas.toDataURL`(which is what JqPlot uses) is not supported by IE8 and thus `jqplotToImageStr` is designed to return `null` for this browser. So, appart from a significant modification of the source code, it looks like we are out of luck – Chopo87 Jul 25 '13 at 14:55
  • I think the above code works on IE 8, can u please check the jqplot sample file on IE 8. – Anoop P S Jul 26 '13 at 04:58
  • Have a look at this post: http://stackoverflow.com/questions/12182598/jqplot-as-image/12202740#12202740. Also, try any of the examples at: http://www.jqplot.com/deploy/dist/examples/ in IE8. You will see you don't get the option to `View Plot Image` ie `jqplotToImageStr`. If you don't have IE8, you can revert IE 9/10 by hitting F12 (Dev tools) and selectiong IE8 under the `Browser Mode` – Chopo87 Jul 26 '13 at 11:40