Class ChartSegment
An abstract base class for all type of chart segments.
Implements
Namespace: Syncfusion.UI.Xaml.SmithChart
Assembly: Syncfusion.SfSmithChart.WPF.dll
Syntax
public abstract class ChartSegment : DependencyObject, INotifyPropertyChanged
Remarks
You can create a custom chart segment by inheriting from ChartSegment. You can also customize the appearance of a chart segment, by specifying values for Interior and StrokeThickness properties.
Constructors
ChartSegment()
Initializes a new instance of the ChartSegment class.
Declaration
public ChartSegment()
Fields
InteriorProperty
The DependencyProperty for Interior property.
Declaration
public static readonly DependencyProperty InteriorProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
StrokeThicknessProperty
The DependencyProperty for StrokeThickness property.
Declaration
public static readonly DependencyProperty StrokeThicknessProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Properties
Interior
Gets or sets the brush to paint the interior of the segment.
Declaration
public Brush Interior { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.Brush | The Brush value. |
Remarks
By default,the interior value for a chart segment will be calculated and set automatically based on the ColorPalette set.
Item
Gets or sets the data object that this segment belongs to.
Declaration
public object Item { get; set; }
Property Value
| Type |
|---|
| System.Object |
Series
Gets or internal sets the value of underlying series of a chart segment.
Declaration
public LineSeries Series { get; }
Property Value
| Type |
|---|
| LineSeries |
StrokeThickness
Gets or sets the stroke thickness value of the segment.
Declaration
public double StrokeThickness { get; set; }
Property Value
| Type |
|---|
| System.Double |
Remarks
By default, this property inherits its value from StrokeThickness property.
Methods
CreateVisual(Size)
Used for creating UIElement for rendering this segment. This method is not intended to be called explicitly outside the Chart but it can be overridden by any derived class.
Declaration
public abstract UIElement CreateVisual(Size size)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Size | size | Size of the panel |
Returns
| Type | Description |
|---|---|
| System.Windows.UIElement | The rendered System.Windows.UIElement |
GetRenderedVisual()
Gets the UIElement used for rendering this segment.
Declaration
public abstract UIElement GetRenderedVisual()
Returns
| Type | Description |
|---|---|
| System.Windows.UIElement | The rendered System.Windows.UIElement |
OnPropertyChanged(String)
Called when Property changed
Declaration
protected virtual void OnPropertyChanged(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The Property Name |
OnSizeChanged(Size)
Called whenever the segment's size changed. This method is not intended to be called explicitly outside the Chart but it can be overridden by any derived class.
Declaration
public abstract void OnSizeChanged(Size size)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Size | size | The Size. |
SetData(Double[])
Sets the values for this segment. This method is not intended to be called explicitly outside the Chart but it can be overridden by any derived class.
Declaration
public virtual void SetData(params double[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double[] | values | The Data |
SetVisualBindings(Shape)
Method Implementation for set Binding to ChartSegments properties
Declaration
protected virtual void SetVisualBindings(Shape element)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Shapes.Shape | element | The Shape |
Update(Point, Point)
Updates the line segments based on its data point value.
Declaration
public abstract void Update(Point point1, Point point2)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Point | point1 | The First Point |
| System.Windows.Point | point2 | The Second Point |
Events
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
| Type |
|---|
| System.ComponentModel.PropertyChangedEventHandler |