The first part you can do by modding the PHP script that fetches your data 
to create a CSV on demand instead of the normal format you output data in. 
 You can either pass the CSV back to the client as a string or create a CSV 
file and pass the url of the file back to the client for download.  That 
will handle the CSV/Excel end if things (since Excel reads CSV files just 
fine, there is generally no reason to specifically convert data into an 
xls/xlsx file - plus, doing so can be a bit of a PITA; if your users demand 
Excel, just rename the extension on the csv file to xls and they will 
probably never be able to tell the difference).  The web export end of 
things will probably be trickier to do.  The API has a method of encoding a 
chart script in a url, which you then set as the src of an iframe, but I 
haven't found any documentation for it, so I'm not quite sure how to do it. 
 If you're feeling adventurous, create a test spreadsheet on Google docs 
and add a chart there, then try to export the chart.  I suspect the HTML it 
gives you will show some hint of what needs to be done.

On Monday, September 3, 2012 3:30:49 AM UTC-4, pankaj khurana wrote:
>
>
> Hi,
>
> I have a csv file which i parse through php and create chart data which is 
> used to render different type of charts.
>
> Now I want to provide the functionality where user can export a particular 
> chart data in various formats like csv,excel and can even publish to web 
> page just like the toolbar example given on following link : Toolbar 
> Link<http://code.google.com/apis/ajax/playground/?type=visualization#toolbar> 
>
> I have analyzed the example and found that the datasource under this were 
> provided as static spreadsheets.
>
> I do not want to convert my data to spreadsheet first as someone suggested 
> in following question: Google chart data table to 
> Excel<https://groups.google.com/forum/#!msg/google-visualization-api/zCtlXlOTBlk/1x8euSLt_0oJ>
>
> And also this approach is not feasible as data is generated dynamically 
> for different set of charts.
>
> Is there any way through which i can make the data export functionality 
> dynamically using php?
>
>
> Regards,
> Pankaj
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/wiRh19TadqoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to