getCanvas() method

Hi,
I am using the getCanvas() method to get the canvas of my chart.
But my browser tells me that object has no property or method called getCanvas().

The lines I am using to get the canvas is

var canvas = chart.getCanvas().canvas;

I am using google Chrome with windows 7 OS.

Hi
There is no such method already.
What the reason of use it? May be we can suggest you some other method/approach.

Hi
I want to print the chart to a pdf.
I saw this post and was trying to get the chart as an image and then insert it into a PDF document.
viewtopic.php?f=8&t=19461&p=63348&hilit=getcanvas#p63348

If you can suggest some other method, I’ll be grateful.

Please, look through the follow link:
viewtopic.php?f=8&t=15573
This info will be helpful for you.

Hi,
I did go through that link and as you can see I was the one who woke up that thread :blush:
I decided to go with jspdf instead of phantom because as far as i understand it, phantomjs needs command line to run it?
Please let me know if I am wrong somewhere.

also,
can i use the html code of the chart to recreate the graph in the PDF, if so most of my problem will be solved.

Hi,

Phanthomjs can be executed from server-side script that you are using. For example, there is the post at stackoverflow about php and phanthomjs:

stackoverflow.com/questions/2020 … s-from-php

can i use the html code of the chart to recreate the graph in the PDF, if so most of my problem will be solved.

We do not have such a ready solution. For this reason, we referred a third-party library - PhanthomJS. However, it doesn’t mean that you can not use any other that suits you.

Hi,
Thank you for the help. :slight_smile:
I used html2canvas and jspdf for this.
Works like a charm :smiley:
For future reference…can you please take a look at html2canvas and do something like that?Although using external libraries is not difficult but if it comes with the charts solution itself it would solve a lot of people a lot of searching :slight_smile:

Hi, poorva
You can leave such request here:
viewforum.php?f=10

Thank you Darya :slight_smile:

You are welcome!