menu

WPF

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

    Show / Hide Table of Contents

    Class HistogramSeries

    Histogram consists tabular frequencies, which are shown as adjacent rectangles and erected over discrete intervals.

    Inheritance
    System.Object
    ChartSeriesBase
    ChartSeries
    AdornmentSeries
    HistogramSeries
    Implements
    ICloneable
    ISupportAxes2D
    ISupportAxes
    Inherited Members
    AdornmentSeries.AddAdornmentAtXY(Double, Double, Int32)
    AdornmentSeries.AddAreaAdornments(IList<Double>[])
    AdornmentSeries.AddColumnAdornments(Double[])
    AdornmentSeries.AdornmentLabelCreated
    AdornmentSeries.AdornmentsInfo
    AdornmentSeries.AdornmentsInfoProperty
    AdornmentSeries.ClearUnUsedAdornments(Int32)
    AdornmentSeries.CreateAdornment(AdornmentSeries, Double, Double, Double, Double)
    AdornmentSeries.OnApplyTemplate()
    ChartSeries.Area
    ChartSeries.GetDataPointIndex(Double, Double)
    ChartSeries.OnCreateAutomationPeer()
    ChartSeries.Stroke
    ChartSeries.StrokeProperty
    ChartSeries.StrokeThickness
    ChartSeries.StrokeThicknessProperty
    ChartSeriesBase.ActualXAxis
    ChartSeriesBase.ActualXValues
    ChartSeriesBase.ActualYAxis
    ChartSeriesBase.Adornments
    ChartSeriesBase.AnimationDuration
    ChartSeriesBase.AnimationDurationProperty
    ChartSeriesBase.ChartTransformer
    ChartSeriesBase.ClearUnUsedSegments(Int32)
    ChartSeriesBase.Clone()
    ChartSeriesBase.ColorModel
    ChartSeriesBase.ColorModelProperty
    ChartSeriesBase.ColorValues
    ChartSeriesBase.CreateEmptyPointSegments(IList<Double>, List<List<Double>>, List<List<Double>>)
    ChartSeriesBase.CreateTransformer(Size, Boolean)
    ChartSeriesBase.DataCount
    ChartSeriesBase.EmptyPointInterior
    ChartSeriesBase.EmptyPointInteriorProperty
    ChartSeriesBase.EmptyPointStyle
    ChartSeriesBase.EmptyPointStyleProperty
    ChartSeriesBase.EmptyPointSymbolTemplate
    ChartSeriesBase.EmptyPointSymbolTemplateProperty
    ChartSeriesBase.EmptyPointValue
    ChartSeriesBase.EmptyPointValueProperty
    ChartSeriesBase.EnableAnimation
    ChartSeriesBase.EnableAnimationProperty
    ChartSeriesBase.FindNearestChartPoint(Point, Double, Double, Double)
    ChartSeriesBase.GeneratePoints(String[], IList<Double>[])
    ChartSeriesBase.GetAvailableSize()
    ChartSeriesBase.GetPreviousSeries(ChartSeriesBase)
    ChartSeriesBase.GetSideBySideInfo(ChartSeriesBase)
    ChartSeriesBase.GetSpacing(DependencyObject)
    ChartSeriesBase.GetXValues()
    ChartSeriesBase.InitialDelayTimer
    ChartSeriesBase.Interior
    ChartSeriesBase.InteriorProperty
    ChartSeriesBase.Invalidate()
    ChartSeriesBase.IsAreaTypeSeries
    ChartSeriesBase.IsBitmapSeries
    ChartSeriesBase.IsColorPathSeries
    ChartSeriesBase.IsIndexed
    ChartSeriesBase.IsLinear
    ChartSeriesBase.IsSeriesVisible
    ChartSeriesBase.IsSeriesVisibleProperty
    ChartSeriesBase.IsSideBySide
    ChartSeriesBase.IsSortData
    ChartSeriesBase.IsSortDataProperty
    ChartSeriesBase.IsStacked
    ChartSeriesBase.IsTooltipAvailable(Canvas)
    ChartSeriesBase.ItemsSource
    ChartSeriesBase.ItemsSourceProperty
    ChartSeriesBase.Label
    ChartSeriesBase.LabelProperty
    ChartSeriesBase.LegendIcon
    ChartSeriesBase.LegendIconProperty
    ChartSeriesBase.LegendIconTemplate
    ChartSeriesBase.LegendIconTemplateProperty
    ChartSeriesBase.ListenPropertyChange
    ChartSeriesBase.ListenPropertyChangeProperty
    ChartSeriesBase.OnDataSourceChanged(DependencyPropertyChangedEventArgs)
    ChartSeriesBase.OnMouseLeave(MouseEventArgs)
    ChartSeriesBase.OnMouseLeftButtonDown(MouseButtonEventArgs)
    ChartSeriesBase.OnMouseLeftButtonUp(MouseButtonEventArgs)
    ChartSeriesBase.OnSeriesMouseDown(Object, Point)
    ChartSeriesBase.OnSeriesMouseUp(Object, Point)
    ChartSeriesBase.Palette
    ChartSeriesBase.PaletteProperty
    ChartSeriesBase.Position(Point, ChartTooltip)
    ChartSeriesBase.PropertyChanged
    ChartSeriesBase.ResumeNotification()
    ChartSeriesBase.SegmentColorPath
    ChartSeriesBase.SegmentColorPathProperty
    ChartSeriesBase.Segments
    ChartSeriesBase.SelectedIndexChanged(Int32, Int32)
    ChartSeriesBase.SelectedSegment
    ChartSeriesBase.SelectedSegments
    ChartSeriesBase.SelectedSegmentsIndexes
    ChartSeriesBase.SeriesSelectionBrush
    ChartSeriesBase.SeriesSelectionBrushProperty
    ChartSeriesBase.SetDoubleAnimation(ChartTooltip)
    ChartSeriesBase.SetIndividualDataTablePoint(Int32, Object, Boolean)
    ChartSeriesBase.SetIndividualPoint(Int32, Object, Boolean)
    ChartSeriesBase.SetSpacing(DependencyObject, Double)
    ChartSeriesBase.SetTooltipDuration()
    ChartSeriesBase.ShowEmptyPoints
    ChartSeriesBase.ShowEmptyPointsProperty
    ChartSeriesBase.ShowTooltip
    ChartSeriesBase.ShowTooltipProperty
    ChartSeriesBase.SortBy
    ChartSeriesBase.SortByProperty
    ChartSeriesBase.SortDirection
    ChartSeriesBase.SortDirectionProperty
    ChartSeriesBase.SpacingProperty
    ChartSeriesBase.SuspendNotification()
    ChartSeriesBase.Timer
    ChartSeriesBase.TooltipTemplate
    ChartSeriesBase.TooltipTemplateProperty
    ChartSeriesBase.TrackBallLabelTemplate
    ChartSeriesBase.TrackBallLabelTemplateProperty
    ChartSeriesBase.UpdateArea()
    ChartSeriesBase.VisibilityOnLegend
    ChartSeriesBase.VisibilityOnLegendProperty
    ChartSeriesBase.XBindingPath
    ChartSeriesBase.XBindingPathProperty
    ChartSeriesBase.YPaths
    Namespace: Syncfusion.UI.Xaml.Charts
    Assembly: Syncfusion.SfChart.WPF.dll
    Syntax
    public class HistogramSeries : AdornmentSeries, ICloneable, ISupportAxes2D, ISupportAxes
    Remarks

    The rectangle area is equal to the frequency of the observations in HistogramInterval The height of a rectangle is also equal to the frequency density of the interval.A histogram may also be normalized displaying relative frequencies. You can also draw a normal distribution curve for the given data points, by enabling the ShowNormalDistributionCurve

    Examples
          <syncfusion:HistogramSeries HistogramInterval="10" ItemsSource="{Binding Data}" XBindingPath="Year" YBindingPath="Value">
          </syncfusion:HistogramSeries>
          HistogramSeries series1 = new HistogramSeries();
          series1.ItemsSource = viewmodel.Data;
          series1.HistogramInterval = "10";
          series1.XBindingPath = "Year";
          series1.YBindingPath = "Value";
          chart.Series.Add(series1);

    Constructors

    HistogramSeries()

    Called when instance created for HistogramSeries

    Declaration
    public HistogramSeries()

    Fields

    CurveLineStyleProperty

    The DependencyProperty for CurveLineStyle property.

    Declaration
    public static readonly DependencyProperty CurveLineStyleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    HistogramIntervalProperty

    The DependencyProperty for HistogramInterval property.

    Declaration
    public static readonly DependencyProperty HistogramIntervalProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ShowNormalDistributionCurveProperty

    The DependencyProperty for ShowNormalDistributionCurve property.

    Declaration
    public static readonly DependencyProperty ShowNormalDistributionCurveProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    XAxisProperty

    The DependencyProperty for XAxis property.

    Declaration
    public static readonly DependencyProperty XAxisProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    YAxisProperty

    The DependencyProperty for YAxis property.

    Declaration
    public static readonly DependencyProperty YAxisProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    YBindingPathProperty

    The DependencyProperty for YBindingPath property.

    Declaration
    public static readonly DependencyProperty YBindingPathProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    Properties

    CurveLineStyle

    Gets or set the line style of HistogramSeries normal distribution curve.

    Declaration
    public Style CurveLineStyle { get; set; }
    Property Value
    Type
    System.Windows.Style
    Examples
          <syncfusion:SfChart.Resources>
                <Style TargetType = "Polyline" x:Key="curveLineStyle">
                < Setter Property = "Stroke" Value="YellowGreen"/>
                < Setter Property = "StrokeThickness" Value="3"/>
                < Setter Property = "StrokeDashArray" Value="1,2" />
                </Style>
          </syncfusion:SfChart.Resources>
          <syncfusion:HistogramSeries HistogramInterval="10" ItemsSource="{Binding Data}" CurveLineStyle = {StaticResource curveLineStyle}
                                         XBindingPath="Year" YBindingPath="Value">
          </syncfusion:HistogramSeries>
          SfChart chart = new SfChart();
          Style style = new Style(typeof(Polyline));
          style.Setters.Add(new Setter(Polyline.StrokeProperty, Brushes.Green));
          style.Setters.Add(new Setter(Polyline.StrokeThicknessProperty, 5.0));
          DoubleCollection doubleCollection = new DoubleCollection();
          doubleCollection.Add(2);
          doubleCollection.Add(3);
          style.Setters.Add(new Setter(Polyline.StrokeDashArrayProperty, doubleCollection));
          HistogramSeries series1 = new HistogramSeries();
          series1.ItemsSource = viewmodel.Data;
          series1.HistogramInterval = "10";
          series1.XBindingPath = "Year";
          series1.YBindingPath = "Value";
          series1.CurveLineStyle = style;
          chart.Series.Add(series1);
    See Also
    ShowNormalDistributionCurve

    HistogramInterval

    Gets or sets a value that specifies the interval to combine in histogram axis. This is a bindable property.

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

    ShowNormalDistributionCurve

    Gets or sets a value indicating whether to enable the distribution curve in the histogram series.

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

    XAxis

    Gets or sets the x axis for the Histogram series.

    Declaration
    public ChartAxisBase2D XAxis { get; set; }
    Property Value
    Type
    ChartAxisBase2D

    XRange

    Gets or sets the x axis range.

    Declaration
    public DoubleRange XRange { get; }
    Property Value
    Type
    DoubleRange

    YAxis

    Gets or sets the y axis for the Histogram series.

    Declaration
    public RangeAxisBase YAxis { get; set; }
    Property Value
    Type
    RangeAxisBase

    YBindingPath

    Gets or sets the property path bind with y axis.

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

    YRange

    Gets or sets the y axis range.

    Declaration
    public DoubleRange YRange { get; }
    Property Value
    Type
    DoubleRange

    Methods

    CloneSeries(DependencyObject)

    Returns the instance of HistogramSeries series.

    Declaration
    protected override DependencyObject CloneSeries(DependencyObject obj)
    Parameters
    Type Name Description
    System.Windows.DependencyObject obj

    object

    Returns
    Type
    System.Windows.DependencyObject
    Overrides
    AdornmentSeries.CloneSeries(DependencyObject)

    CreateSegment()

    Creates an instance of series segment.

    Declaration
    protected override ChartSegment CreateSegment()
    Returns
    Type Description
    ChartSegment

    Returns the instance of corresponding series segment.

    Overrides
    ChartSeries.CreateSegment()
    Remarks

    This customization is not supported for fast type series and technical indicators.

    Examples

    This sample shows how to call the CreateSegment() method to customize the line series segments.

    public class LineSeriesExt : LineSeries
    {​ 
        protected override ChartSegment CreateSegment()
        {​
            return new LineSegmentExt();
        }​
    }​
    
    public class LineSegmentExt : LineSegment
    {​
        public override UIElement CreateVisual(Size size)
        {​
            // Write your customization code here.
        }​
    
        public override void Update(IChartTransformer transformer)
        {​
            // Write your customization code here.
        }​
    }

    CreateSegments()

    Creates the segments of HistogramSeries.

    Declaration
    public override void CreateSegments()
    Overrides
    AdornmentSeries.CreateSegments()

    GeneratePoints()

    Method used to generate points for histogram series.

    Declaration
    protected override void GeneratePoints()
    Overrides
    AdornmentSeries.GeneratePoints()

    OnBindingPathChanged(DependencyPropertyChangedEventArgs)

    Called when binding path changed.

    Declaration
    protected override void OnBindingPathChanged(DependencyPropertyChangedEventArgs args)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs args

    Event args

    Overrides
    ChartSeriesBase.OnBindingPathChanged(DependencyPropertyChangedEventArgs)
    See Also
    YBindingPath

    OnDataSourceChanged(IEnumerable, IEnumerable)

    Called when ItemsSource property changed.

    Declaration
    protected override void OnDataSourceChanged(IEnumerable oldValue, IEnumerable newValue)
    Parameters
    Type Name Description
    System.Collections.IEnumerable oldValue

    old value

    System.Collections.IEnumerable newValue

    new value

    Overrides
    AdornmentSeries.OnDataSourceChanged(IEnumerable, IEnumerable)

    OnMouseMove(MouseEventArgs)

    Called when pointer or mouse move on chart area.

    Declaration
    protected override void OnMouseMove(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseEventArgs e

    Event args

    Overrides
    ChartSeriesBase.OnMouseMove(MouseEventArgs)

    OnXAxisChanged(ChartAxis, ChartAxis)

    Called when XAxis value changed.

    Declaration
    protected virtual void OnXAxisChanged(ChartAxis oldAxis, ChartAxis newAxis)
    Parameters
    Type Name Description
    ChartAxis oldAxis

    old axis

    ChartAxis newAxis

    new axis

    OnYAxisChanged(ChartAxis, ChartAxis)

    Called when YAxis property changed.

    Declaration
    protected virtual void OnYAxisChanged(ChartAxis oldAxis, ChartAxis newAxis)
    Parameters
    Type Name Description
    ChartAxis oldAxis

    old axis

    ChartAxis newAxis

    new axis

    UpdateSegments(Int32, NotifyCollectionChangedAction)

    Updates the segment at the specified index.

    Declaration
    public override void UpdateSegments(int index, NotifyCollectionChangedAction action)
    Parameters
    Type Name Description
    System.Int32 index

    The index of the segment.

    System.Collections.Specialized.NotifyCollectionChangedAction action

    The action that caused the segments collection changed event

    Overrides
    ChartSeriesBase.UpdateSegments(Int32, NotifyCollectionChangedAction)

    Explicit Interface Implementations

    ISupportAxes.ActualXAxis

    Declaration
    ChartAxis ISupportAxes.ActualXAxis { get; }
    Returns
    Type
    ChartAxis

    ISupportAxes.ActualYAxis

    Declaration
    ChartAxis ISupportAxes.ActualYAxis { get; }
    Returns
    Type
    ChartAxis

    Implements

    ICloneable
    ISupportAxes2D
    ISupportAxes

    See Also

    HistogramSegment
    ColumnSeries
    BarSeries
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved