Class ScatterSeries
ScatterSeries displays data points as set of circular symbols. Values are being represented by the position of the symbols on the chart.
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.SfChart.WPF.dll
Syntax
public class ScatterSeries : XySegmentDraggingBase, ICloneable, ISupportAxes2D, ISupportAxes, ISegmentSelectable
Remarks
ScatterSeries are typically used to compare aggregated data across categories.
Examples
<syncfusion:ScatterSeries ScatterHeight = "10" ScatterWidth = "10" ItemsSource="{Binding Data}" XBindingPath="Year" YBindingPath="Value">
</syncfusion:ScatterSeries>
ScatterSeries series1 = new ScatterSeries();
series1.ItemsSource = viewmodel.Data;
series1.ScatterHeight = 10;
series1.ScatterWidth = 10;
series1.XBindingPath = "Year";
series1.YBindingPath = "Value";
chart.Series.Add(series1);
Constructors
ScatterSeries()
Declaration
public ScatterSeries()
Fields
CustomTemplateProperty
The DependencyProperty for CustomTemplate property.
Declaration
public static readonly DependencyProperty CustomTemplateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
DragDirectionProperty
The DependencyProperty for DragDirection property.
Declaration
public static readonly DependencyProperty DragDirectionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ScatterHeightProperty
The DependencyProperty for ScatterHeight property.
Declaration
public static readonly DependencyProperty ScatterHeightProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ScatterWidthProperty
The DependencyProperty for ScatterWidth property.
Declaration
public static readonly DependencyProperty ScatterWidthProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SegmentSelectionBrushProperty
The DependencyProperty for SegmentSelectionBrush property.
Declaration
public static readonly DependencyProperty SegmentSelectionBrushProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectedIndexProperty
The DependencyProperty for SelectedIndex property.
Declaration
public static readonly DependencyProperty SelectedIndexProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
CustomTemplate
Gets or sets the custom template for this series.
Declaration
public DataTemplate CustomTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.DataTemplate | System.Windows.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>
DragDirection
Gets or sets the dragging direction.
Declaration
public DragType DragDirection { get; set; }
Property Value
Type |
---|
DragType |
ScatterHeight
Gets or sets a value that specifies the height of the chart scatter segment. This is a bindable property.
Declaration
public double ScatterHeight { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
The default value is 20.
ScatterWidth
Gets or sets a value that specifies the width of the chart scatter segment. This is a bindable property.
Declaration
public double ScatterWidth { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
The default value is 20.
SegmentSelectionBrush
Gets or sets the interior(brush) for the selected segment(s).
Declaration
public Brush SegmentSelectionBrush { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | The System.Windows.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 |
|
Methods
CloneSeries(DependencyObject)
Returns the instance of ScatterSeries series.
Declaration
protected override DependencyObject CloneSeries(DependencyObject obj)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | obj | object |
Returns
Type |
---|
System.Windows.DependencyObject |
Overrides
CreateSegment()
Creates an instance of series segment.
Declaration
protected override ChartSegment CreateSegment()
Returns
Type | Description |
---|---|
ChartSegment | Returns the instance of corresponding series segment. |
Overrides
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 ScatterSeries.
Declaration
public override void CreateSegments()
Overrides
OnChartDragDelta(Point, Object)
Called when dragging series.
Declaration
protected override void OnChartDragDelta(Point mousePos, object originalSource)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Point | mousePos | mouse position |
System.Object | originalSource | original source |
Overrides
OnChartDragEnd(Point, Object)
Called when dragging end.
Declaration
protected override void OnChartDragEnd(Point mousePos, object originalSource)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Point | mousePos | mouse position |
System.Object | originalSource | original source |
Overrides
OnChartDragEntered(Point, Object)
Called when dragging entered.
Declaration
protected override void OnChartDragEntered(Point mousePos, object originalSource)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Point | mousePos | mouse position |
System.Object | originalSource | original source |
Overrides
OnChartDragExited(Point, Object)
Called when dragging exit.
Declaration
protected override void OnChartDragExited(Point mousePos, object originalSource)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Point | mousePos | mouse position |
System.Object | originalSource | original source |
Overrides
OnChartDragStart(Point, Object)
Called when dragging started.
Declaration
protected override void OnChartDragStart(Point mousePos, object originalSource)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Point | mousePos | mouse position |
System.Object | originalSource | original source |
Overrides
OnTouchDown(TouchEventArgs)
Called when touch down on series.
Declaration
protected override void OnTouchDown(TouchEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.TouchEventArgs | e | Event args |
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 |