0
我正在用c#開發並使用EPPLUS庫創建Excel表,特別是 我創建了餅圖,其中我也顯示零值,但是我想刪除它們。我一直無法找到任何解決方法。下面的代碼我使用:如何使用EPPLUS庫在餅圖中隱藏零值
<pre> int chart_RegionHeaderRow = 1;
int chart_RegionHeaderColumn = 13;
firstRowCategory = 2;
lastRowCategory = 2;
firstColCategory = 3;
lastColCategory = firstColCategory + pDeployVersionSet.Length - 1;
int firstColValue = 3;
int lastColValue = firstColValue + pDeployVersionSet.Length - 1;
int firstRowSerie = 3;
int rowCR = chart_RegionHeaderRow;
int colCR = chart_RegionHeaderColumn;
int chart_RegionColStep = 6;
int chart_RegionRowStep = 16;
//Create the Region chart WW
var chartWW = (ExcelPieChart)worksheet.Drawings.AddChart("pieChartDeployWW", eChartType.Pie);
chartWW.SetSize(300, 300);
chartWW.SetPosition(rowCR, 0, colCR, 0);
chartWW.Title.Text = "WW";
chartWW.DataLabel.ShowValue = true;
chartWW.DataLabel.ShowPercent = true;
chartWW.DataLabel.ShowLeaderLines = true;
indexSerie = firstRowSerie;
chartWW.Series.Add(ExcelRange.GetAddress(indexSerie + _RegionsSet.Length,
firstColValue,
indexSerie + _RegionsSet.Length,
lastColValue),
ExcelRange.GetAddress(firstRowCategory, firstColCategory, lastRowCategory, lastColCategory <code>
,也是導致Excel文件:
我希望有人可以給我方向。 謝謝
歡迎來到Stackoverflow。你能分享一些代碼嗎?看看這個鏈接指導如何提出問題https://stackoverflow.com/help/how-to-ask – gareththegeek