How to print the chart

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« 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 Vrushali on 27th November 2013
Hello,


If I click on any HTML button then I want to print chart.I don't want to save that as image and then print.It should get directly printed when I click on any button.How can I do this?


Regards,
Vrushali
Posted by RGraph support on 27th November 2013
Hi there,

You will need to instruct the browser to print the page - which you can do with the window.print() function: Eg:

www.rgraph.net/fiddle/view/a-scatter-chart-using-getxcoords-with-a-string-value





Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
    www.rgraph.net/license#single-site
Posted by Vrushali on 27th November 2013
Hello,


window.print() will print whole page.I want to print only chart.please tell me is there any option for that.




Regards,
Vrushali
Posted by RGraph support on 27th November 2013
Hi there,

You could use the canvas API method toDataUrl() and open that URL in a new window - and then print that using the print functionality in the browser (File -> Print). Or you could pass the URL to a page as a GET parameter which then displays it and at the bottom of the page there's some JavaScript that automatically calls window.print().




Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
    www.rgraph.net/license#single-site
Posted by vrushali on 28th November 2013
Hi,

Thanks for support.

toDataUrl() is not working in IE7,IE8.It returning url as 'undefined'.Is there any way to do it in IE8,IE7.

Regards,
vrushali
Posted by RGraph support on 28th November 2013
Hi there,

IE7 and IE8 both use ExCanvas as a compatibility layer since they don't support canvas - so the toDataUrl() function won't work in these browsers. The regular print page menu item may work for these browsers - I've not tested it.



Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
    www.rgraph.net/license#single-site

Add a reply




« Back to message list