/// <summary> /// Adds gridlines and styles them according to the style selected in the StyleManager /// </summary> /// <param name="addMajor">Indicates if the Major gridlines should be added</param> /// <param name="addMinor">Indicates if the Minor gridlines should be added</param> public void AddGridlines(bool addMajor = true, bool addMinor = false) { if (addMajor) { CreateNode(_majorGridlinesPath); _chart.ApplyStyleOnPart(this, _chart._styleManager?.Style?.GridlineMajor); } if (addMinor) { CreateNode(_minorGridlinesPath); _chart.ApplyStyleOnPart(this, _chart._styleManager?.Style?.GridlineMinor); } }
/// <summary> /// Creates a data table in the plotarea /// The datatable can also be accessed via the DataTable propery /// <see cref="DataTable"/> /// </summary> public virtual ExcelChartDataTable CreateDataTable() { if (DataTable != null) { throw (new InvalidOperationException("Data table already exists")); } DataTable = new ExcelChartDataTable(_firstChart, NameSpaceManager, TopNode); _firstChart.ApplyStyleOnPart(DataTable, _firstChart._styleManager?.Style?.DataTable); return(DataTable); }
internal ExcelChartTitle(ExcelChart chart, XmlNamespaceManager nameSpaceManager, XmlNode node, string nsPrefix) : base(nameSpaceManager, node) { _chart = chart; _nsPrefix = nsPrefix; titlePath = string.Format(titlePath, nsPrefix); if (chart._isChartEx) { AddSchemaNodeOrder(new string[] { "tx", "bodyPr", "lstStyle", "layout", "p", "overlay", "spPr", "txPr" }, ExcelDrawing._schemaNodeOrderSpPr); CreateTopNode(); } else { AddSchemaNodeOrder(_chart._chartXmlHelper.SchemaNodeOrder, ExcelDrawing._schemaNodeOrderSpPr); CreateTopNode(); if (TopNode.HasChildNodes == false) { TopNode.InnerXml = GetInitXml("c"); chart.ApplyStyleOnPart(this, chart.StyleManager?.Style?.Title, true); } } }