【发布时间】:2017-09-27 12:37:49
【问题描述】:
我正在使用 c# 开发并使用 EPPLUS 库来创建 excel 表,特别是 我创建了饼图,其中也显示了零值,但我想删除它们。我找不到任何解决方法。在我使用的代码下方:
<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。你能分享一些代码吗?查看此链接以获取有关如何提问stackoverflow.com/help/how-to-ask 的指导