[英]C# Excel Interop: How to set cells height and width in pixels?
[英]interop word c# set chart height / width
我目前正在使用c#构建报告,然后将其输出到word。
我已经建立了图表并被数据填充,但是我无法理解的一件事是如何设置图表的大小/高度。
花了几个小时完成这项看似简单的任务,将不胜感激。
码:
Chart CashflowChart = _document.InlineShapes.AddChart(XlChartType.xlColumnClustered).Chart;
CashflowChart.ChartArea.Height = 100;
这导致以下错误:
{"Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))"}
经过数小时的混乱,这与msdn docs所说的不能直接编辑图表区域相反,您可以编辑chartchara的父图表对象:
CashflowChart.Parent.width = 550; CashflowChart.Parent.height = 150;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.