UWP

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class LineSeries - UWP API Reference | Syncfusion

    Show / Hide Table of Contents

    Class LineSeries

    Line chart displays series as a set of points connected using a straight line to represent large amounts of data observed over a continuous period of time.

    Inheritance
    System.Object
    ChartSeriesBase
    ChartSeries
    AdornmentSeries
    CartesianSeries
    XyDataSeries
    XySegmentDraggingBase
    XySeriesDraggingBase
    LineSeries
    Implements
    ICloneable
    ISupportAxes2D
    ISupportAxes
    ISegmentSelectable
    Inherited Members
    XySeriesDraggingBase.EnableSeriesDraggingProperty
    XySeriesDraggingBase.OnPointerPressed(PointerRoutedEventArgs)
    XySeriesDraggingBase.OnPointerReleased(PointerRoutedEventArgs)
    XySeriesDraggingBase.OnPointerEntered(PointerRoutedEventArgs)
    XySeriesDraggingBase.OnPointerExited(PointerRoutedEventArgs)
    XySeriesDraggingBase.OnChartDragDelta(Point, Object)
    XySeriesDraggingBase.OnChartDragEntered(Point, Object)
    XySeriesDraggingBase.OnChartDragExited(Point, Object)
    XySeriesDraggingBase.UpdateUnderLayingModel(String, IList<Double>)
    XySeriesDraggingBase.EnableSeriesDragging
    XySegmentDraggingBase.DragTooltipStyleProperty
    XySegmentDraggingBase.EnableDragTooltipProperty
    XySegmentDraggingBase.DragTooltipTemplateProperty
    XySegmentDraggingBase.RoundToDecimalProperty
    XySegmentDraggingBase.SnapToPointProperty
    XySegmentDraggingBase.EnableSegmentDraggingProperty
    XySegmentDraggingBase.UpdateSourceProperty
    XySegmentDraggingBase.DragCancelKeyModifiersProperty
    XySegmentDraggingBase.ResetDragSpliter()
    XySegmentDraggingBase.RaiseDragStart(ChartDragStartEventArgs)
    XySegmentDraggingBase.RaiseDragEnd(ChartDragEndEventArgs)
    XySegmentDraggingBase.RaiseDragDelta(DragDelta)
    XySegmentDraggingBase.RaiseDragEnter(XySegmentEnterEventArgs)
    XySegmentDraggingBase.RaisePreviewEnd(XyPreviewEndEventArgs)
    XySegmentDraggingBase.UpdateUnderLayingModel(String, Int32, Object)
    XySegmentDraggingBase.DragTooltipStyle
    XySegmentDraggingBase.EnableDragTooltip
    XySegmentDraggingBase.DragTooltipTemplate
    XySegmentDraggingBase.RoundToDecimal
    XySegmentDraggingBase.SnapToPoint
    XySegmentDraggingBase.EnableSegmentDragging
    XySegmentDraggingBase.UpdateSource
    XySegmentDraggingBase.DragCancelKeyModifiers
    XySegmentDraggingBase.SegmentIndex
    XySegmentDraggingBase.DragSpliter
    XySegmentDraggingBase.DraggedXValue
    XySegmentDraggingBase.DraggedValue
    XySegmentDraggingBase.Tooltip
    XySegmentDraggingBase.DragInfo
    XySegmentDraggingBase.EllipseAnimation
    XySegmentDraggingBase.SegmentEnter
    XySegmentDraggingBase.DragStart
    XySegmentDraggingBase.DragDelta
    XySegmentDraggingBase.DragEnd
    XySegmentDraggingBase.PreviewDragEnd
    XyDataSeries.YBindingPathProperty
    XyDataSeries.GeneratePoints()
    XyDataSeries.OnDataSourceChanged(IEnumerable, IEnumerable)
    XyDataSeries.OnBindingPathChanged(DependencyPropertyChangedEventArgs)
    XyDataSeries.YBindingPath
    XyDataSeries.YValues
    CartesianSeries.TrendlinesProperty
    CartesianSeries.XAxisProperty
    CartesianSeries.YAxisProperty
    CartesianSeries.IsTransposedProperty
    CartesianSeries.ShowTrackballInfoProperty
    CartesianSeries.OnVisibleRangeChanged(VisibleRangeChangedEventArgs)
    CartesianSeries.OnYAxisChanged(ChartAxis, ChartAxis)
    CartesianSeries.OnXAxisChanged(ChartAxis, ChartAxis)
    CartesianSeries.OnApplyTemplate()
    CartesianSeries.GetDataPoints(Rect)
    CartesianSeries.GetDataPoints(Double, Double, Double, Double)
    CartesianSeries.Trendlines
    CartesianSeries.XRange
    CartesianSeries.YRange
    CartesianSeries.XAxis
    CartesianSeries.YAxis
    CartesianSeries.IsTransposed
    CartesianSeries.ShowTrackballInfo
    CartesianSeries.ISupportAxes.ActualXAxis
    CartesianSeries.ISupportAxes.ActualYAxis
    AdornmentSeries.AdornmentsInfoProperty
    AdornmentSeries.CreateAdornment(AdornmentSeries, Double, Double, Double, Double)
    AdornmentSeries.AddColumnAdornments(Double[])
    AdornmentSeries.AddAdornmentAtXY(Double, Double, Int32)
    AdornmentSeries.AddAreaAdornments(IList<Double>[])
    AdornmentSeries.ClearUnUsedAdornments(Int32)
    AdornmentSeries.AdornmentsInfo
    AdornmentSeries.AdornmentLabelCreated
    ChartSeries.StrokeProperty
    ChartSeries.StrokeThicknessProperty
    ChartSeries.GetDataPointIndex(Double, Double)
    ChartSeries.StrokeThickness
    ChartSeries.Area
    ChartSeries.Stroke
    ChartSeriesBase.SpacingProperty
    ChartSeriesBase.TooltipTemplateProperty
    ChartSeriesBase.ShowTooltipProperty
    ChartSeriesBase.ListenPropertyChangeProperty
    ChartSeriesBase.IsSeriesVisibleProperty
    ChartSeriesBase.XBindingPathProperty
    ChartSeriesBase.SortByProperty
    ChartSeriesBase.SortDirectionProperty
    ChartSeriesBase.IsSortDataProperty
    ChartSeriesBase.PaletteProperty
    ChartSeriesBase.ItemsSourceProperty
    ChartSeriesBase.TrackBallLabelTemplateProperty
    ChartSeriesBase.InteriorProperty
    ChartSeriesBase.LabelProperty
    ChartSeriesBase.LegendIconProperty
    ChartSeriesBase.LegendIconTemplateProperty
    ChartSeriesBase.VisibilityOnLegendProperty
    ChartSeriesBase.SeriesSelectionBrushProperty
    ChartSeriesBase.ColorModelProperty
    ChartSeriesBase.SegmentColorPathProperty
    ChartSeriesBase.EnableAnimationProperty
    ChartSeriesBase.AnimationDurationProperty
    ChartSeriesBase.EmptyPointValueProperty
    ChartSeriesBase.EmptyPointStyleProperty
    ChartSeriesBase.EmptyPointSymbolTemplateProperty
    ChartSeriesBase.ShowEmptyPointsProperty
    ChartSeriesBase.EmptyPointInteriorProperty
    ChartSeriesBase.Segments
    ChartSeriesBase.Timer
    ChartSeriesBase.InitialDelayTimer
    ChartSeriesBase.ChartTransformer
    ChartSeriesBase.YPaths
    ChartSeriesBase.GetSpacing(DependencyObject)
    ChartSeriesBase.SetSpacing(DependencyObject, Double)
    ChartSeriesBase.FindNearestChartPoint(Point, Double, Double, Double)
    ChartSeriesBase.CreateEmptyPointSegments(IList<Double>, List<List<Double>>, List<List<Double>>)
    ChartSeriesBase.UpdateSegments(Int32, NotifyCollectionChangedAction)
    ChartSeriesBase.GetAvailableSize()
    ChartSeriesBase.SuspendNotification()
    ChartSeriesBase.ResumeNotification()
    ChartSeriesBase.Invalidate()
    ChartSeriesBase.GetSideBySideInfo(ChartSeriesBase)
    ChartSeriesBase.Clone()
    ChartSeriesBase.OnSeriesMouseUp(Object, Point)
    ChartSeriesBase.OnSeriesMouseDown(Object, Point)
    ChartSeriesBase.CreateTransformer(Size, Boolean)
    ChartSeriesBase.GetXValues()
    ChartSeriesBase.SetTooltipDuration()
    ChartSeriesBase.IsTooltipAvailable(Canvas)
    ChartSeriesBase.SetIndividualPoint(Int32, Object, Boolean)
    ChartSeriesBase.SetIndividualDataTablePoint(Int32, Object, Boolean)
    ChartSeriesBase.ClearUnUsedSegments(Int32)
    ChartSeriesBase.Position(Point, ChartTooltip)
    ChartSeriesBase.UpdateArea()
    ChartSeriesBase.GetPreviousSeries(ChartSeriesBase)
    ChartSeriesBase.GeneratePoints(String[], IList<Double>[])
    ChartSeriesBase.OnDataSourceChanged(DependencyPropertyChangedEventArgs)
    ChartSeriesBase.EmptyPointValue
    ChartSeriesBase.EmptyPointStyle
    ChartSeriesBase.EmptyPointSymbolTemplate
    ChartSeriesBase.ShowEmptyPoints
    ChartSeriesBase.EmptyPointInterior
    ChartSeriesBase.DataCount
    ChartSeriesBase.IsSortData
    ChartSeriesBase.SortDirection
    ChartSeriesBase.SortBy
    ChartSeriesBase.TooltipTemplate
    ChartSeriesBase.ShowTooltip
    ChartSeriesBase.ListenPropertyChange
    ChartSeriesBase.Adornments
    ChartSeriesBase.IsSeriesVisible
    ChartSeriesBase.Palette
    ChartSeriesBase.ItemsSource
    ChartSeriesBase.TrackBallLabelTemplate
    ChartSeriesBase.Interior
    ChartSeriesBase.Label
    ChartSeriesBase.LegendIcon
    ChartSeriesBase.LegendIconTemplate
    ChartSeriesBase.VisibilityOnLegend
    ChartSeriesBase.SeriesSelectionBrush
    ChartSeriesBase.ColorModel
    ChartSeriesBase.XBindingPath
    ChartSeriesBase.SegmentColorPath
    ChartSeriesBase.EnableAnimation
    ChartSeriesBase.AnimationDuration
    ChartSeriesBase.IsSideBySide
    ChartSeriesBase.IsAreaTypeSeries
    ChartSeriesBase.IsBitmapSeries
    ChartSeriesBase.IsColorPathSeries
    ChartSeriesBase.IsIndexed
    ChartSeriesBase.ColorValues
    ChartSeriesBase.ActualXValues
    ChartSeriesBase.SelectedSegmentsIndexes
    ChartSeriesBase.SelectedSegment
    ChartSeriesBase.ActualXAxis
    ChartSeriesBase.ActualYAxis
    ChartSeriesBase.IsStacked
    ChartSeriesBase.PropertyChanged
    Namespace: Syncfusion.UI.Xaml.Charts
    Assembly: Syncfusion.SfChart.UWP.dll
    Syntax
    public class LineSeries : XySeriesDraggingBase, ICloneable, ISupportAxes2D, ISupportAxes, ISegmentSelectable
    Remarks

    LineChart appearance can be customized by using CustomTemplate property.

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

    Constructors

    LineSeries()

    Declaration
    public LineSeries()

    Fields

    CustomTemplateProperty

    The DependencyProperty for CustomTemplate property.

    Declaration
    public static readonly DependencyProperty CustomTemplateProperty
    Field Value
    Type Description
    Windows.UI.Xaml.DependencyProperty

    SegmentSelectionBrushProperty

    The DependencyProperty for SegmentSelectionBrush property.

    Declaration
    public static readonly DependencyProperty SegmentSelectionBrushProperty
    Field Value
    Type Description
    Windows.UI.Xaml.DependencyProperty

    SelectedIndexProperty

    The DependencyProperty for SelectedIndex property.

    Declaration
    public static readonly DependencyProperty SelectedIndexProperty
    Field Value
    Type Description
    Windows.UI.Xaml.DependencyProperty

    StrokeDashArrayProperty

    The Dependency property forStrokeDashArray property.

    Declaration
    public static readonly DependencyProperty StrokeDashArrayProperty
    Field Value
    Type Description
    Windows.UI.Xaml.DependencyProperty

    Properties

    CustomTemplate

    Gets or sets the custom template for this series.

    Declaration
    public DataTemplate CustomTemplate { get; set; }
    Property Value
    Type Description
    Windows.UI.Xaml.DataTemplate
    Examples

    This example, we are using ScatterSeries.

        <syncfusion:ScatterSeries ItemsSource="{Binding Demands}" XBindingPath="Demand" YBindingPath="Year2010" 
                       ScatterHeight="40" ScatterWidth="40">
           <syncfusion:ScatterSeries.CustomTemplate>
                <DataTemplate>
                    <Canvas>
                       <Path Data="M20.125,32l0.5,12.375L10.3125,12.375L10.3125,0.5L29.9375,0.5L29.9375,12.375L39.75,12.375Z" Stretch="Fill"
                           Fill="{Binding Interior}" Height="{Binding ScatterHeight}" Width="{Binding ScatterWidth}" 
                           Canvas.Left="{Binding RectX}" Canvas.Top="{Binding RectY}"/>
                    </Canvas>
                </DataTemplate>
            </syncfusion:ScatterSeries.CustomTemplate>
        </syncfusion:ScatterSeries>

    IsLinear

    Gets the value which confirms whether this series in linearity.

    Declaration
    protected override bool IsLinear { get; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    ChartSeriesBase.IsLinear
    Remarks

    Returns true if its linear, otherwise it returns false.

    SegmentSelectionBrush

    Gets or sets the interior(brush) for the selected segment(s).

    Declaration
    public Brush SegmentSelectionBrush { get; set; }
    Property Value
    Type Description
    Windows.UI.Xaml.Media.Brush

    The Windows.UI.Xaml.Media.Brush value.

    SelectedIndex

    Gets or sets the index of the selected segment.

    Declaration
    public int SelectedIndex { get; set; }
    Property Value
    Type Description
    System.Int32

    Int value represents the index of the data point(or segment) to be selected.

    SelectedSegments

    Gets the selected segments in this series, when we enable the multiple selection.

    Declaration
    protected override List<ChartSegment> SelectedSegments { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<ChartSegment>

    It returns list of ChartSegment.

    Overrides
    ChartSeriesBase.SelectedSegments

    StrokeDashArray

    Gets or sets the stroke dash array for line to customize the appearance of LineSeries. This is a bindable property.

    Declaration
    public DoubleCollection StrokeDashArray { get; set; }
    Property Value
    Type Description
    Windows.UI.Xaml.Media.DoubleCollection

    .

    Methods

    CloneSeries(DependencyObject)

    Returns the instance of LineSeries series.

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

    object

    Returns
    Type Description
    Windows.UI.Xaml.DependencyObject
    Overrides
    XyDataSeries.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 LineSeries.

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

    OnChartDragEnd(Point, Object)

    Called when dragging ended.

    Declaration
    protected override void OnChartDragEnd(Point mousePos, object originalSource)
    Parameters
    Type Name Description
    Windows.Foundation.Point mousePos

    mouse position

    System.Object originalSource

    original source

    Overrides
    XySegmentDraggingBase.OnChartDragEnd(Point, Object)

    OnChartDragStart(Point, Object)

    Called when dragging started.

    Declaration
    protected override void OnChartDragStart(Point mousePos, object originalSource)
    Parameters
    Type Name Description
    Windows.Foundation.Point mousePos

    mouse position

    System.Object originalSource

    original source

    Overrides
    XySegmentDraggingBase.OnChartDragStart(Point, Object)

    OnPointerMoved(PointerRoutedEventArgs)

    Called when pointer or mouse move on chart area.

    Declaration
    protected override void OnPointerMoved(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Windows.UI.Xaml.Input.PointerRoutedEventArgs e

    Event args

    Overrides
    XySeriesDraggingBase.OnPointerMoved(PointerRoutedEventArgs)

    OnTapped(TappedRoutedEventArgs)

    Used to update the series tooltip when tapping on the series segments.

    Declaration
    protected override void OnTapped(TappedRoutedEventArgs e)
    Parameters
    Type Name Description
    Windows.UI.Xaml.Input.TappedRoutedEventArgs e

    TappedRoutedEventArgs

    Overrides
    ChartSeriesBase.OnTapped(TappedRoutedEventArgs)

    ResetDraggingElements(String, Boolean)

    Resets the dragging elements.

    Declaration
    protected override void ResetDraggingElements(string reason, bool dragEndEvent)
    Parameters
    Type Name Description
    System.String reason

    The reason.

    System.Boolean dragEndEvent

    if set to true, DragEndEvent will raise.

    Overrides
    XySeriesDraggingBase.ResetDraggingElements(String, Boolean)

    SelectedIndexChanged(Int32, Int32)

    Method used to set SegmentSelectionBrush to SelectedIndex segment.

    Declaration
    protected override void SelectedIndexChanged(int newIndex, int oldIndex)
    Parameters
    Type Name Description
    System.Int32 newIndex

    new index

    System.Int32 oldIndex

    old index

    Overrides
    ChartSeriesBase.SelectedIndexChanged(Int32, Int32)

    SetDoubleAnimation(ChartTooltip)

    Method used to set the animation.

    Declaration
    protected override void SetDoubleAnimation(ChartTooltip chartTooltip)
    Parameters
    Type Name Description
    ChartTooltip chartTooltip

    ChartTooltip

    Overrides
    ChartSeriesBase.SetDoubleAnimation(ChartTooltip)

    Implements

    ICloneable
    ISupportAxes2D
    ISupportAxes
    ISegmentSelectable

    Extension Methods

    DateTimeExtension.ToDateTime(Object)

    See Also

    LineSegment
    FastLineSeries
    FastLineBitmapSeries
    SplineSeries
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved