menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface IChartDropBar - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Interface IChartDropBar

    Represents up or down bars for the line chart.

    Inherited Members
    IChartFillBorder.Fill
    IChartFillBorder.Has3dProperties
    IChartFillBorder.HasInterior
    IChartFillBorder.HasLineProperties
    IChartFillBorder.HasShadowProperties
    IChartFillBorder.Interior
    IChartFillBorder.LineProperties
    IChartFillBorder.Shadow
    IChartFillBorder.ThreeD
    Namespace: Syncfusion.XlsIO
    Assembly: Syncfusion.XlsIO.Base.dll
    Syntax
    public interface IChartDropBar : IChartFillBorder

    Properties

    Gap

    Gets or sets the gap width of the drop bar in percent (0 to 500%).

    Declaration
    int Gap { get; set; }
    Property Value
    Type
    System.Int32
    Examples

    The following code illustrates how to access IChartDropBar and set Gap value for Line chart.

            using (ExcelEngine excelEngine = new ExcelEngine())
            {
                //Create worksheet
                IApplication application = excelEngine.Excel;
                application.DefaultVersion = ExcelVersion.Excel2013;
                IWorkbook workbook = application.Workbooks.Create(1);
                IWorksheet sheet = workbook.Worksheets[0];
    
                //Add data
                sheet.Range["A1"].Text = "Jan";
                sheet.Range["B1"].Text = "Feb";
                sheet.Range["C1"].Text = "Mar";
                sheet.Range["A2"].Value = "10";
                sheet.Range["B2"].Value = "20";
                sheet.Range["C2"].Value = "30";
                sheet.Range["A3"].Value = "15";
                sheet.Range["B3"].Value = "25";
                sheet.Range["C3"].Value = "35";
    
                //Create chart
                IChart chart = sheet.Charts.Add();
    
                //Set range
                chart.DataRange = sheet.Range["A1:C3"];
    
                //Set chart type
                chart.ChartType = ExcelChartType.Line;
    
                //Set chart drop bar
                IChartDropBar dropBar = chart.Series[0].SerieFormat.CommonSerieOptions.FirstDropBar;
    
                //Set gap
                dropBar.Gap = 90;
    
                //Save and Dispose
                workbook.SaveAs("Chart.xlsx");
                workbook.Close();
            }
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved