小编PRA*_*RAF的帖子

EPPlus如何在EXCEL中更改PIE图表的颜色

如何以编程方式使用EPPlus更改Excel饼图的默认颜色.

下面是我的代码

var pieChart = worksheet.Drawings.AddChart("piechart", eChartType.Pie3D) as ExcelPieChart;
            //Set top left corner to row 1 column 2
            pieChart.SetPosition(18, 0, 0, 0);
            pieChart.SetSize(350, 300);
            pieChart.Series.Add(ExcelRange.GetAddress(12, 2, 15, 2),ExcelRange.GetAddress(12, 1, 15, 1) );
            pieChart.Legend.Position = eLegendPosition.Bottom;
            pieChart.Legend.Border.Fill.Color = Color.Green;
            pieChart.Legend.Border.LineStyle = eLineStyle.Solid;              
            pieChart.Legend.Border.Fill.Style = eFillStyle.SolidFill;
            pieChart.Title.Text = "Current Status";               
            pieChart.DataLabel.ShowCategory = false;
            pieChart.DataLabel.ShowPercent = true;
Run Code Online (Sandbox Code Playgroud)

我想将默认颜色更改为一些明亮的颜色.

建议并对此进行一些说明.

epplus

5
推荐指数
2
解决办法
4787
查看次数

标签 统计

epplus ×1