如何使用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;
我希望将默认颜色更改为一些明亮的颜色。
请提出建议并对此进行说明。
c:pieChart
而不是c:lineChart
,但是这个扩展非常棒。 - Steven