Rijo

Store fusion Chart in a variable

Recommended Posts

Hello,

I have rendered fusion chart using php wrappers.

I want to store the chart, to be stored in a variable so that i can print it wherever I need it.

Basically I want to do this to print the chart in a html page which will be later converted to pdf.

Any information or suggestion on how to perform either of them?

Thank You

Share this post


Link to post
Share on other sites

Hi,

FusionCharts is a javascript charting library and charts can be exported only after chart is rendered on webpage. You can make use of FusionCharts API method `getSVGString` to get chart SVG once it is rendered and this SVG string can be stored in variable and you can export HTML page embedding chart SVG in it.

Share this post


Link to post
Share on other sites

hi,

Thanks for replying.

I tried getSVGString but the issue is i am using php wrapper to render the chart and even if i try the getsvgstring method in javascript it just displays the svg tags and no svg string.

It would have been helpful if you could provide me an example.

And i also tried FCImg chart libary, url you provided has been changed and cant download it.

Thank You.

Share this post


Link to post
Share on other sites

Hi,

Thanks for replying back, from the latest version for getting the svg string using FusionCharts api method getSVGString you have to provide a callback Function if asyncRender is set to 1 (default) where you get the svg-string as a parameter of the callback function. 

Please check this sample fiddle for reference - http://jsfiddle.net/fusioncharts/pxum77g5/

Also please note, that from version 3.12.0 asyncRender is to 1 by default when a chart is rendered.

FCImg is a third party tool, we dont provide support for that, however you can easily export chart into images by using exportEnabled attribute at the chart level and setting it to 1

For details regarding export feature please refer this doc url - http://www.fusioncharts.com/dev/exporting-charts/exporting-charts-as-image-and-pdf.html

Or you can also set up private export server in PHP, for using this feature please go through this page  - http://www.fusioncharts.com/dev/exporting-charts/server-side-export/setup-private-export-server-php.html

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now