menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class WaterfallSeries - API Reference

    Show / Hide Table of Contents

    Class WaterfallSeries

    The WaterfallSeries shows that an initial value is affected by a series of intermediate positive or negative values, leading to a final value.

    Inheritance
    System.Object
    ChartSeries
    CartesianSeries
    XYDataSeries
    WaterfallSeries
    Inherited Members
    XYDataSeries.YBindingPathProperty
    XYDataSeries.StrokeWidthProperty
    XYDataSeries.YBindingPath
    XYDataSeries.StrokeWidth
    CartesianSeries.XAxisNameProperty
    CartesianSeries.YAxisNameProperty
    CartesianSeries.DataLabelSettingsProperty
    CartesianSeries.LabelProperty
    CartesianSeries.ShowTrackballLabelProperty
    CartesianSeries.OnBindingContextChanged()
    CartesianSeries.XAxisName
    CartesianSeries.YAxisName
    CartesianSeries.DataLabelSettings
    CartesianSeries.Label
    CartesianSeries.ActualXAxis
    CartesianSeries.ActualYAxis
    CartesianSeries.ShowTrackballLabel
    ChartSeries.ItemsSourceProperty
    ChartSeries.XBindingPathProperty
    ChartSeries.FillProperty
    ChartSeries.PaletteBrushesProperty
    ChartSeries.IsVisibleProperty
    ChartSeries.OpacityProperty
    ChartSeries.EnableAnimationProperty
    ChartSeries.EnableTooltipProperty
    ChartSeries.TooltipTemplateProperty
    ChartSeries.ShowDataLabelsProperty
    ChartSeries.LegendIconProperty
    ChartSeries.IsVisibleOnLegendProperty
    ChartSeries.SelectionBehaviorProperty
    ChartSeries.GetDataPointIndex(Single, Single)
    ChartSeries.CreateAnimation(Action<Double>)
    ChartSeries.DrawDataLabel(ICanvas, Brush, String, PointF, Int32)
    ChartSeries.DrawSeries(ICanvas, ReadOnlyObservableCollection<ChartSegment>, RectF)
    ChartSeries.ItemsSource
    ChartSeries.XBindingPath
    ChartSeries.Fill
    ChartSeries.PaletteBrushes
    ChartSeries.IsVisible
    ChartSeries.Opacity
    ChartSeries.EnableAnimation
    ChartSeries.EnableTooltip
    ChartSeries.TooltipTemplate
    ChartSeries.ShowDataLabels
    ChartSeries.LegendIcon
    ChartSeries.IsVisibleOnLegend
    ChartSeries.SelectionBehavior
    ChartSeries.XRange
    ChartSeries.YRange
    Namespace: Syncfusion.Maui.Charts
    Assembly: Syncfusion.Maui.Charts.dll
    Syntax
    public class WaterfallSeries : XYDataSeries, IDatapointSelectionDependent, ITooltipDependent, IDrawCustomLegendIcon
    Remarks

    To render a series, create an instance of WaterfallSeries class, and add it to the Series collection.

    It provides options for Fill, PaletteBrushes, StrokeWidth, and Opacity to customize the appearance.

    EnableTooltip - A tooltip displays information while tapping or mouse hovering above a segment. To display the tooltip on a chart, you need to set the EnableTooltip property as true in WaterfallSeries class, and also refer TooltipBehavior property.

    Data Label - Data labels are used to display values related to a chart segment. To render the data labels, you need to set the ShowDataLabels property as true in WaterfallSeries class. To customize the chart data labels alignment, placement, and label styles, you need to create an instance of CartesianDataLabelSettings and set to the DataLabelSettings property.

    Animation - To animate the series, set True to the EnableAnimation property.

    Spacing - To specify the spacing between segments using the Spacing property.

    Examples
    • Xaml
    • C#
    • ViewModel
        <chart:SfCartesianChart>
    
              <chart:SfCartesianChart.XAxes>
                  <chart:CategoryAxis/>
              </chart:SfCartesianChart.XAxes>
    
              <chart:SfCartesianChart.YAxes>
                  <chart:NumericalAxis/>
              </chart:SfCartesianChart.YAxes>
    
              <chart:SfCartesianChart.Series>
                  <chart:WaterfallSeries
                      ItemsSource="{Binding Sales}"
                      XBindingPath="Department"
                      YBindingPath="Value"/>
              </chart:SfCartesianChart.Series>  
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
    
        CategoryAxis xAxis = new CategoryAxis();
        NumericalAxis yAxis = new NumericalAxis();
    
        chart.XAxes.Add(xAxis);
        chart.YAxes.Add(yAxis);
    
        ViewModel viewModel = new ViewModel();
    
        WaterfallSeries series = new WaterfallSeries();
        series.ItemsSource = viewModel.Sales;
        series.XBindingPath = "Department";
        series.YBindingPath = "Value";
        chart.Series.Add(series);
        public ObservableCollection<Model> Sales { get; set; }
    
        public ViewModel()
        {
           Sales = new ObservableCollection<Model>();
           Sales.Add(new ChartDataModel() { Department = "Income", Value = 46 });
           Sales.Add(new ChartDataModel() { Department = "Sales", Value = -14 });
           Sales.Add(new ChartDataModel() { Department = "Research", Value = -9});
           Sales.Add(new ChartDataModel() { Department = "Revenue", Value = 15 });
           Sales.Add(new ChartDataModel() { Department = "Balance", Value = 38 , IsSummary= true });
           Sales.Add(new ChartDataModel() { Department = "Expense", Value = -13 });
           Sales.Add(new ChartDataModel() { Department = "Tax", Value = -8 });
           Sales.Add(new ChartDataModel() { Department = "Profit", Value =17,IsSummary=true });
        }

    Constructors

    WaterfallSeries()

    Initializes a new instance of the WaterfallSeries class.

    Declaration
    public WaterfallSeries()

    Fields

    AllowAutoSumProperty

    Identifies the AllowAutoSum bindable property.

    Declaration
    public static readonly BindableProperty AllowAutoSumProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    ConnectorLineStyleProperty

    Identifies the ConnectorLineStyle bindable property.

    Declaration
    public static readonly BindableProperty ConnectorLineStyleProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    NegativePointsBrushProperty

    Identifies the NegativePointsBrush bindable property.

    Declaration
    public static readonly BindableProperty NegativePointsBrushProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    ShowConnectorProperty

    Identifies the ShowConnectorLine bindable property.

    Declaration
    public static readonly BindableProperty ShowConnectorProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    SpacingProperty

    Identifies the Spacing bindable property.

    Declaration
    public static readonly BindableProperty SpacingProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    SummaryBindingPathProperty

    Identifies the SummaryBindingPath bindable property.

    Declaration
    public static readonly BindableProperty SummaryBindingPathProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    SummaryPointsBrushProperty

    Identifies the SummaryPointsBrush bindable property.

    Declaration
    public static readonly BindableProperty SummaryPointsBrushProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    WidthProperty

    Identifies the Width bindable property.

    Declaration
    public static readonly BindableProperty WidthProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    Properties

    AllowAutoSum

    Gets or sets a value that determines whether the intermediate sum values in a series should be automatically calculated or not.

    Declaration
    public bool AllowAutoSum { get; set; }
    Property Value
    Type Description
    System.Boolean

    It accepts System.Boolean values, and its default value is true.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
              <chart:WaterfallSeries ItemsSource="{Binding Sales}"   
                                     XBindingPath="Department"   
                                     YBindingPath="Value"
                                     AllowAutoSum="False"/>
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        WaterfallSeries series = new WaterfallSeries()
        {
              ItemsSource = viewModel.Sales,
              XBindingPath = "Department",
              YBindingPath = "Value",
              AllowAutoSum="False",
        };
    
        chart.Series.Add(series);

    ConnectorLineStyle

    Gets or sets a style for connector lines, and it is often used to customize the appearance of connector lines for visual purposes.

    Declaration
    public ChartLineStyle ConnectorLineStyle { get; set; }
    Property Value
    Type Description
    ChartLineStyle

    It accepts ChartLineStyle values, and its default value is null.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
              <chart:WaterfallSeries ItemsSource="{Binding Sales}"   
                                                        XBindingPath="Department"   
                                                        YBindingPath="Value"/>
                  <chart:WaterfallSeries.ConnectorLineStyle>
                          <chart:ChartLineStyle Stroke="Red" >
                   </chart:WaterfallSeries.ConnectorLineStyle>
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        WaterfallSeries series = new WaterfallSeries()
        {
              ItemsSource = viewModel.Sales,
              XBindingPath = "Department",
              YBindingPath = "Value",
        };
        series.ConnectorLineStyle = new ChartLineStyle()
        {
             Stroke = new SolidColorBrush(Colors.Red),
         }
    
        chart.Series.Add(series);

    NegativePointsBrush

    Gets or sets a brush value that indicates the Negative segment's interior.

    Declaration
    public Brush NegativePointsBrush { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.Brush

    It accepts Microsoft.Maui.Controls.Brush values, and its default value is null.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
              <chart:WaterfallSeries ItemsSource="{Binding Sales}"   
                                                        XBindingPath="Department"   
                                                        YBindingPath="Value"
                                                        NegativePointsBrush="Red"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        WaterfallSeries series = new WaterfallSeries()
        {
              ItemsSource = viewModel.Sales,
              XBindingPath = "Department",
              YBindingPath = "Value",
              NegativePointsBrush=Colors.Red,
        };
    
        chart.Series.Add(series);

    ShowConnectorLine

    Gets or sets a value indicating whether to enable the connector line between the segements or not.

    Declaration
    public bool ShowConnectorLine { get; set; }
    Property Value
    Type Description
    System.Boolean

    It accepts System.Boolean values, and its default value is true.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
              <chart:WaterfallSeries ItemsSource="{Binding Sales}"   
                                     XBindingPath="Department"   
                                     YBindingPath="Value"
                                     ShowConnectorline="False"/>      
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        WaterfallSeries series = new WaterfallSeries()
        {
              ItemsSource = viewModel.Sales,
              XBindingPath = "Department",
              YBindingPath = "Value",
              ShowConnectorline="False",
        };
    
        chart.Series.Add(series);

    Spacing

    Gets or sets the spacing between the segments across the series in cluster mode.

    Declaration
    public double Spacing { get; set; }
    Property Value
    Type Description
    System.Double

    It accepts System.Double values and its default value is 0d

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
              <chart:WaterfallSeries ItemsSource="{Binding Sales}"   
                                                        XBindingPath="Department"   
                                                        YBindingPath="Value"
                                                        Spacing="1"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        WaterfallSeries series = new WaterfallSeries()
        {
              ItemsSource = viewModel.Sales,
              XBindingPath = "Department",
              YBindingPath = "Value",
              Spacing = 1,
        };
    
        chart.Series.Add(series);

    SummaryBindingPath

    Gets or sets a string value that indicates the sum of previous segments.

    Declaration
    public string SummaryBindingPath { get; set; }
    Property Value
    Type Description
    System.String

    It accepts System.String values, and its default value is null.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
              <chart:WaterfallSeries ItemsSource="{Binding Sales}"   
                                     XBindingPath="Department"   
                                     YBindingPath="Value"
                                     SummaryBindingpath="IsSummary"/>
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        WaterfallSeries series = new WaterfallSeries()
        {
              ItemsSource = viewModel.Sales,
              XBindingPath = "Department",
              YBindingPath = "Value",
              SummaryBindingpath="IsSummary",
        };
    
        chart.Series.Add(series);

    SummaryPointsBrush

    Gets or sets a brush value that indicates the summary segment's interior.

    Declaration
    public Brush SummaryPointsBrush { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.Brush

    It accepts Microsoft.Maui.Controls.Brush values, and its default value is string.Empty.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
              <chart:WaterfallSeries ItemsSource="{Binding Sales}"   
                                     XBindingPath="Department"   
                                     YBindingPath="Value"
                                     SummaryPointsBrush="Blue"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        WaterfallSeries series = new WaterfallSeries()
        {
              ItemsSource = viewModel.Sales,
              XBindingPath = "Department",
              YBindingPath = "Value",
              SummaryPointsBrush=Colors.Blue,
        };
    
        chart.Series.Add(series);

    Width

    Gets or sets the width of each segment.

    Declaration
    public double Width { get; set; }
    Property Value
    Type Description
    System.Double

    It accepts System.Double values and its default value is 0.8

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
              <chart:WaterfallSeries ItemsSource="{Binding Sales}"   
                                                        XBindingPath="Department"   
                                                        YBindingPath="Value"
                                                        Width="1"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        WaterfallSeries series = new WaterfallSeries()
        {
              ItemsSource = viewModel.Sales,
              XBindingPath = "Department",
              YBindingPath = "Value",
              Width=1,
        };
    
        chart.Series.Add(series);

    Methods

    CreateSegment()

    Creates the Waterfall segments.

    Declaration
    protected override ChartSegment CreateSegment()
    Returns
    Type Description
    ChartSegment
    Overrides
    ChartSeries.CreateSegment()

    See Also

    WaterfallSegment
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved