开发者

Can I export FusionCharts data to a CSV file, saved as text/csv (or other graceful solution)?

Right now, FusionCharts 3.1 Flash charts provide a context menu that, if you configure it appropriately, will allow the user to save the data as a JPG / PNG / PDF file. The same menu also allows CSV data to be copied to clipboard.

Excel 2010 does not handle pasted CSV as one might wish here: it pastes into one line per cell without separating on commas. You can, with a song and dance, have the CSV interpreted: click on Data, then Text to Columns, then Delimited and Next, then uncheck Tab and check Comma as separator, and then Finish (English translation: "Please call our help desk!"). This is really a few steps too many for usability concerns.

One could imagine a slightly shorter song and dance (perh开发者_Python百科aps open up Notepad, paste, and save with a .csv extension), but I would ideally like people to run on a mental model of "I save the data, open it with Excel, and see the data naturally."

Is there a way to let FusionCharts export CSV as text/csv so there is no song and dance required of the end user beyond "Save the data and open it in Excel"?


Could you please try once setting exportDataSeparator='{tab}' in <chart> and try again? My Excel in mac seems to respond well using this.

I have used this XML and right clicked on chart to copy data to clip-board and pasted in excel:

<chart exportDataSeparator='{tab}' showExportDataMenuItem='1'caption='Weekly Sales Summary'  xAxisName='Week' yAxisName='Sales' numberPrefix='$' >
    <categories>
        <category label='Dec'/>
        <category label='Jan'/>
        <category label='Feb'/>
        <category label='Mar'/>
        <category label='Apr'/>
        <category label='May'/>

    </categories>

    <dataset seriesName='current'>
        <set value='123123' />
        <set value='123123' />
        <set value='123123' />
        <set value='123123' />
        <set value='123123' />
        <set value='123123' />
    </dataset>
    <dataset seriesName='2010'>
        <set value='123123' />
        <set value='123123' />
        <set value='123123' />
        <set value='123123' />
        <set value='123123' />
        <set value='123123' />
    </dataset>
</chart>

My excel in mac shows this:

Can I export FusionCharts data to a CSV file, saved as text/csv (or other graceful solution)?

And so is my windows Excel 2010:

Can I export FusionCharts data to a CSV file, saved as text/csv (or other graceful solution)?


Not natively, but you can use the javascript API to copy it to a Javascript variable (see http://www.fusioncharts.com/docs/ExportDataJS.html) and then use Downloadify or HTML5 data uris to generate a save file dialog (as covered here Using HTML5/Javascript to generate and save a file).

Let me know if that works: kinda interesting, didn't realize this was running around.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜