/// <summary> /// Creates an empty style and color for chart, ready to be customized /// </summary> public void CreateEmptyStyle(eChartStyle fallBackStyle = eChartStyle.Style2) { if (fallBackStyle == eChartStyle.None) { throw new InvalidOperationException("The chart must have a style. Please set the charts Style property to a value different than None or Call LoadStyleXml with the fallBackStyle parameter"); } var p = _chart.WorkSheet.Workbook._package.Package; var id = CreateStylePart(p); StyleXml = new XmlDocument(); StyleXml.LoadXml(GetStartStyleXml(id)); StyleXml.Save(StylePart.GetStream()); Style = new ExcelChartStyle(NameSpaceManager, StyleXml.DocumentElement, this); _chart.InitChartTheme((int)fallBackStyle); CreateColorXml(p); }