Sign in to follow this  
andrei_b_c

Multiple Graph Images From The Save Chart

Recommended Posts

Hi,

 

I have a chart that have a fixed height and a variable width.

I'm exporting the graph as image and include it in a PDF file.

This works fine, however when the X axis is very big, the exported image will be very small.

The best solution will be to split the graph in multiple graphs.

Does anyone now how to split the X axis, so there will be maximum 20 values on this axis for instance?

Also I need to export all images and include in the PDF.

For example if there are 60 values for the X axis, there should be 3 images, so - 3 pages in the exported PDF.

 

Thanks for any help.

Share this post


Link to post
Share on other sites

Hi,

 

This is not possible. FusionCharts does not support splitting of X-axis.

 

Thanks for the answer.

 

One solution that should work is to split the generated XML in multiple XML strings and create multiple graphs.

But here I came to another problem - I need to export all graphs, then finally to get the PDF file.

But when the exportChart() method is called and the server script returns no data, the page is redirected and nothing gets displayed...

Is there a way to change this? I tried to change the exportTargetWindow property (_self/_blank), but it didn't help.

 

Thanks.

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

Are you trying to export JavaScript charts or Flash charts?

 

Could you please send us the sample code and chart XML ?

Share this post


Link to post
Share on other sites

Thanks for the answer.

 

One solution that should work is to split the generated XML in multiple XML strings and create multiple graphs.

But here I came to another problem - I need to export all graphs, then finally to get the PDF file.

But when the exportChart() method is called and the server script returns no data, the page is redirected and nothing gets displayed...

Is there a way to change this? I tried to change the exportTargetWindow property (_self/_blank), but it didn't help.

 

Thanks.

 

I also have the same view of splitting the chart's data into multiple charts and export them all.

 

However, saving all charts into one single image file is not possible through server side export. You can however, do this easily using our client side export handler (in case you are using Flash charts).

 

I have created a simple example to showcase this. Please find the attached example.

 

Though a bit crudely coded (I really wished to achieved this as fast as possible) and with little aesthetics - just to focus on the main implementation -

 

a ) the example shows a single series column 2D chart with 60 columns.

 

B) I split the chart into many using a maximum of 15 column each (you can also configure this number through the code)

 

c) Also added an export component in batch mode.

 

e) There is an HTML button to initiate export which calls a JS function

 

f) The function first caches the existing chart and then takes its data and split the data into many split charts - here 4 charts with #n (split number) added to the caption for indentification. Meanwhile the original/cached chart is removed from the page

 

g) The split charts after rendering will get exported

 

h) Once all split charts are exported, these are removed and the original/cached chart is rendered back in the page.

 

 

The first view may be jerky :( - but the idea can be further polished to a great extent to stop all the jerks.

 

Hope this can flare up better implementation.

 

Happy FusionCharting!

splitchart-n-export.zip

Share this post


Link to post
Share on other sites

Hi,

 

And here is a sample with better aesthetics and no flicker (all split charts are rendered and exported through an almost hidden container).

 

http://igcomm.com/sh...chart-n-export/

 

NOTE: This will work only for Flash charts and only using client-side export mechanism.

 

Hi there,

 

Thank you for the answers, but unfortunately I'm using JavaScript charts.

I found some examples that export charts using FusionChartsExportObject object, but could not make it working.

I just need to split the graph, export all graphs and finally download the PDF file.

Is it possible to do it using JavaScript charts?

 

Thanks in advance.

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
Sign in to follow this