在 HTML 页面中显示 Excel 图表
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15584068/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Display a Excel chart in Html page
提问by Sourav048
I have a EXCEL file containing multiple Tables and Charts. I want to create a web page to display a particular Table and a Chart. I used java script to display the table. But cant find a way to display the CHART. By chart i mean it contains a pie graph or bar graph.
我有一个包含多个表格和图表的 EXCEL 文件。我想创建一个网页来显示特定的表格和图表。我使用java脚本来显示表格。但找不到显示图表的方法。图表我的意思是它包含一个饼图或条形图。
Is it possible to display using java script? Or do i have to use JSP/something else?
是否可以使用java脚本显示?还是我必须使用 JSP/其他东西?
回答by Benjamin Kaiser
Take a look at Google Chart Tools. Here is an examplewith javascript source code. If you are building the table on the server side, you may instead want to pass the data down JSON encoded and then build both the table and chart at the same time without having to pass the data twice.
看看谷歌图表工具。这是一个带有 javascript 源代码的示例。如果您在服务器端构建表格,您可能希望将数据向下传递 JSON 编码,然后同时构建表格和图表,而不必两次传递数据。
回答by Pallav
An easier way would be to use a free tool like oomfo, which is a PowerPoint plugin to create charts. It lets you pull data from excel, create charts and then export the entire slide as HTML - the charts are in Flash and JavaScript (fallback). Just add a line of code in the output web page to render JavaScript charts only.
更简单的方法是使用像 oomfo 这样的免费工具,这是一个用于创建图表的 PowerPoint 插件。它允许您从 excel 中提取数据,创建图表,然后将整个幻灯片导出为 HTML - 图表使用 Flash 和 JavaScript(后备)。只需在输出网页中添加一行代码即可仅呈现 JavaScript 图表。