简体   繁体   English

在Excel工作表中创建图表[与数据C#一起在同一工作表中]

[英]Create charts in excel sheet [ in same sheet along with data C#]

Can we create charts in excel sheet passing data directly from datatable and then bind baar and pie charts with data and on the same sheet can also have many other values in different cells passed by c# code. 我们能否在excel工作表中创建图表,直接从datatable传递数据,然后将baar和pie图表与数据绑定,并且在同一工作表上,c#代码在不同的单元格中还可以具有许多其他值。

Please see attached image for clear view. 请查看附件图像以查看清晰的图像。

Thanks 谢谢 w

It's unfortunately not that easy :(. You need to use the OpenXMLSDK. The best way is to create a template excel file with charts in it and write data to the excel sheets, then set the data range of the charts to the data section. 不幸的是,它不是那么简单:(。您需要使用OpenXMLSDK。最好的方法是创建一个带有图表的模板excel文件,然后将数据写入excel工作表,然后将图表的数据范围设置为数据部分。

OpenSDK-Download: http://www.microsoft.com/en-us/download/details.aspx?id=5124 OpenSDK下载: http : //www.microsoft.com/zh-cn/download/details.aspx?id= 5124

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM