/// <summary> /// Dispose the object /// </summary> public void Dispose() { if (_chart != null) { _chart.Dispose(); } _chart = null; _line = null; if (_fill != null) { _fill.Dispose(); } _fill = null; }
/// <summary> /// Removes gridlines from the Axis /// </summary> /// <param name="removeMajor">Indicates if the Major gridlines should be removed</param> /// <param name="removeMinor">Indicates if the Minor gridlines should be removed</param> public void RemoveGridlines(bool removeMajor, bool removeMinor) { if (removeMajor) { DeleteNode(_majorGridlinesPath); _majorGridlines = null; } if (removeMinor) { DeleteNode(_minorGridlinesPath); _minorGridlines = null; } }
/// <summary> /// Set picture border. /// </summary> /// <param name="border">Target border.</param> /// <param name="model">Border to draw.</param> public static void SetBorder(this ExcelDrawingBorder border, XlsxBorder model) { SentinelHelper.ArgumentNull(border, nameof(border)); SentinelHelper.ArgumentNull(model, nameof(model)); if (model.Show == YesNo.No) { return; } border.Fill.Style = eFillStyle.SolidFill; border.Fill.Color = model.GetColor(); border.Fill.Transparancy = model.Transparency; border.LineStyle = model.Style.ToEppLineStyle(); border.Width = model.Width; }
private void ApplyStyleBorder(ExcelDrawingBorder chartBorder, ExcelChartStyleEntry section, int indexForColor, int numberOfItems) { if (section.HasBorder) //Has border inner section { chartBorder.SetFromXml(section.Border.LineElement); } else if (section.BorderReference.Index > 0) //From theme { var theme = GetTheme(); if (theme.FormatScheme.BorderStyle.Count > section.BorderReference.Index - 1) { var border = theme.FormatScheme.BorderStyle[section.BorderReference.Index - 1]; chartBorder.SetFromXml(border.LineElement); } } TransformColorBorder(chartBorder, section.BorderReference.Color, indexForColor, numberOfItems); }
private void TransformColorBorder(ExcelDrawingBorder border, ExcelChartStyleColorManager color, int colorIndex, int numberOfItems) { TransformColorFillBasic(border.Fill, color, colorIndex, numberOfItems); }