jqPlot Print Issues and Exporting to Excel possibilities.

1,346 views
Skip to first unread message

Pawan Pillai

unread,
Dec 15, 2010, 7:24:20 AM12/15/10
to jqplot-users
Hi,
Thanks for providing such a great chart plugin !

I have 2 questions here...

1. When I try to print the chart created using jqPlot, the chart is
either completely invisible, or is aligned improperly in the print.
Does anyone else is also facing this issue?

2. Is there any was to export the charts prepared to MS Excel?

Regards,
Pawan Pillai

John Stile

unread,
Dec 16, 2010, 9:02:09 PM12/16/10
to jqplot...@googlegroups.com

I found a hack to save the plot as an image.
It isn't a great solution, as some of the text is missing from the
graph. I haven't figured this out yet.
//---------------------------------------------
//
// Hack to save as an image file
//
function plot_to_image(){
//
// create image file
//

// content type header, to force download

var newCanvas = document.createElement("canvas");
newCanvas.width = $("#chartDiv_sizerev_vs_date").width();
newCanvas.height = $("#chartDiv_sizerev_vs_date").height();
var baseOffset = $("#chartDiv_sizerev_vs_date").offset();
$("#chartDiv_sizerev_vs_date canvas").each(function () {
var offset = $(this).offset();
newCanvas.getContext("2d").drawImage(this,
offset.left - baseOffset.left,
offset.top - baseOffset.top);
});
document.location.href = newCanvas.toDataURL();
}

Chris Leonello

unread,
Dec 16, 2010, 9:05:05 PM12/16/10
to jqplot...@googlegroups.com
> 1. When I try to print the chart created using jqPlot, the chart is
> either completely invisible, or is aligned improperly in the print.
> Does anyone else is also facing this issue?

What browser and platform are you using? What version of jqPlot?

Print capability is a function of the browser. jqPlot renders canvas and div elements (or VML elements for IE). I have sometimes had issues with IE, but generally good results with other browsers.

> 2. Is there any was to export the charts prepared to MS Excel?


No.

--
Chris Leonello
jqplot...@jqplot.com

> --
> You received this message because you are subscribed to the Google Groups "jqplot-users" group.
> To post to this group, send email to jqplot...@googlegroups.com.
> To unsubscribe from this group, send email to jqplot-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jqplot-users?hl=en.
>

Suresh Baskaran

unread,
Apr 23, 2013, 2:11:46 AM4/23/13
to jqplot...@googlegroups.com
Hi 
     Still I am facing this problem.Is there any solution has been found for it.

Regards
Suresh
Reply all
Reply to author
Forward
0 new messages