我可以将 FusionCharts 数据导出到 CSV 文件,另存为 text/csv (或其他优雅的解决方案)吗?
目前,FusionCharts 3.1 Flash 图表提供了一个上下文菜单,如果您对其进行适当配置,将允许用户将数据保存为 JPG / PNG / PDF 文件。同一菜单还允许将 CSV 数据复制到剪贴板。
Excel 2010 并不像人们希望的那样处理粘贴的 CSV:它粘贴到每个单元格一行中,而不用逗号分隔。您可以通过歌曲和舞蹈来解释 CSV:单击“数据”,然后单击“文本到列”,然后单击“分隔符”和“下一步”,然后取消选中“制表符”并选中“逗号”作为分隔符,然后单击“完成”(英文翻译:“请致电我们的服务台” !”)。对于可用性问题来说,这确实是太多的步骤了。
人们可以想象一首稍微短一点的歌曲和舞蹈(也许打开记事本,粘贴,然后用 .csv 扩展名保存),但我理想地希望人们以“我保存数据,用 Excel 打开它,并自然地看到数据。”
有没有办法让 FusionCharts 将 CSV 导出为文本/csv,这样最终用户除了“保存数据并在 Excel 中打开”之外不需要任何歌舞?
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 (perhaps 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"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试在中设置exportDataSeparator='{tab}'吗?然后再试一次?我的 Mac 中的 Excel 使用此功能似乎反应良好。
我使用了此 XML 并右键单击图表将数据复制到剪贴板并粘贴到 Excel 中:
我在 mac 中的 excel 显示了以下内容:
我的 Windows Excel 2010 也是如此:
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:
My excel in mac shows this:
And so is my windows Excel 2010:
本身不是,但您可以使用 javascript API 将其复制到 Javascript 变量(请参阅 http:// /www.fusioncharts.com/docs/ExportDataJS.html),然后使用 Downloadify 或 HTML5 数据 uri 生成保存文件对话框(如此处所述 使用 HTML5/Javascript 生成并保存文件)。
让我知道这是否有效:有点有趣,没有意识到这是到处乱跑。
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.