簡體   English   中英

互操作字C#設置圖表的高度/寬度

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM