有谁知道如何使用openXml在C#中设置条形图/条形图的颜色?
到目前为止,我有这个:
foreach (var solidFill in barChartSeries.ChartShapeProperties.Descendants<SolidFill>().ToList())
{
solidFill.SchemeColor = ???
}
任何想法,我怎么能自己找到类似的东西。确实缺少文档。
在@ wp78de的帮助下,我找到了解决方案:
从代码创建新图表时,必须在构造函数调用中添加所有子代:
new BarChartSeries(
new ChartShapeProperties(
new DocumentFormat.OpenXml.Drawing.SolidFill(
new DocumentFormat.OpenXml.Drawing.RgbColorModelHex() { Val = "FFA9FF" }
)
)
);
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句