Class SparkLine
Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.
Step 1a) Using this custom control in a XAML file that exists in the current project. Add this XmlNamespace attribute to the root element of the markup file where it is to be used:
xmlns:MyNamespace="clr-namespace:SparkLine"
Step 1b) Using this custom control in a XAML file that exists in a different project. Add this XmlNamespace attribute to the root element of the markup file where it is to be used:
xmlns:MyNamespace="clr-namespace:SparkLine;assembly=SparkLine"
You will also need to add a project reference from the project where the XAML file lives to this project and Rebuild to avoid compilation errors:
Right click on the target project in the Solution Explorer and "Add Reference"->"Projects"->[Select this project]
Step 2) Go ahead and use your control in the XAML file.
Inheritance
Namespace: Syncfusion.Windows.Chart
Assembly: Syncfusion.Chart.Wpf.dll
Syntax
public class SparkLine : Control
Constructors
SparkLine()
Constructor for SparkLine
Declaration
public SparkLine()
Fields
BandRangeProperty
Identifies the BandRange dependency property.
Declaration
public static DependencyProperty BandRangeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Data
Declaration of collection variable.
Declaration
public ObservableCollection<double> Data
Field Value
Type |
---|
System.Collections.ObjectModel.ObservableCollection<System.Double> |
DataMemberPathProperty
Dependency property for DataMemberPath
Declaration
public static readonly DependencyProperty DataMemberPathProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
FirstPointHighlightBrushProperty
Identifies the FirstPointHighlightBrush dependency property.
Declaration
public static readonly DependencyProperty FirstPointHighlightBrushProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
HighPointHighlightBrushProperty
Identifies the HighPointHighlightBrush dependency property.
Declaration
public static readonly DependencyProperty HighPointHighlightBrushProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
InteriorProperty
DependencyProperty for Sparkline Interior
Declaration
public static readonly DependencyProperty InteriorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsEnableRangeBandProperty
dependency property for Check RangeBand is enabled or not
Declaration
public static DependencyProperty IsEnableRangeBandProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsFirstPointHighlightedProperty
Dependency property for IsFirstPointHighlighted
Declaration
public static readonly DependencyProperty IsFirstPointHighlightedProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsHighPointHighlightedProperty
Identifies the IsHighPointHighlighted dependency property.
Declaration
public static readonly DependencyProperty IsHighPointHighlightedProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsLastPointHighlightedProperty
Dependency property for IsLastPointHighlighted
Declaration
public static readonly DependencyProperty IsLastPointHighlightedProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsLowPointHighlightedProperty
Dependency property for IsLowPointHighlighted
Declaration
public static readonly DependencyProperty IsLowPointHighlightedProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsMarkerEnabledProperty
Dependency property for IsMarkerEnabled
Declaration
public static readonly DependencyProperty IsMarkerEnabledProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsNegativePointsHighlightedProperty
Dependency property for IsNegativePointsHighlighted
Declaration
public static readonly DependencyProperty IsNegativePointsHighlightedProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ItemsSourceProperty
Dependency property for ItemsSource for Sparkline
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LastPointHighlightBrushProperty
Identifies the LastPointHighlightBrush dependency property.
Declaration
public static readonly DependencyProperty LastPointHighlightBrushProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LineMarkerTypeProperty
Using a DependencyProperty as the backing store for LineMarkerType. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LineMarkerTypeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LowPointHighlightBrushProperty
Identifies the LowPointHighlightBrush dependency property.
Declaration
public static readonly DependencyProperty LowPointHighlightBrushProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MarkerColorProperty
DependencyProperty for MarkerColorProperty
Declaration
public static readonly DependencyProperty MarkerColorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
NegativePointsHighlightBrushProperty
Identifies the NegativePointsHighlightBrush dependency property.
Declaration
public static readonly DependencyProperty NegativePointsHighlightBrushProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
OriginLineStrokeProperty
Using a DependencyProperty as the backing store for OriginLineStroke. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty OriginLineStrokeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
OriginProperty
Using a DependencyProperty as the backing store for Origin. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty OriginProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
RangeBandInteriorProperty
Dependency proeprty for RangeBandInterior
Declaration
public static DependencyProperty RangeBandInteriorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ShowAxisProperty
Using a DependencyProperty as the backing store for ShowAxis. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ShowAxisProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SparkLineTypeProperty
DependencyProperty for Type for Sparkline
Declaration
public static readonly DependencyProperty SparkLineTypeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
StrokeProperty
DependencyProperty for Sparkline Stroke
Declaration
public static readonly DependencyProperty StrokeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
StrokeThicknessProperty
DependencyProperty for Sparkline StrokeThickness
Declaration
public static readonly DependencyProperty StrokeThicknessProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
VerticalAxisEndPointModeProperty
Using a DependencyProperty as the backing store for VerticalAxisEndPointMode. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty VerticalAxisEndPointModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
VerticalAxisMaximumValueProperty
Using a DependencyProperty as the backing store for VerticalAxisMaximumValue. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty VerticalAxisMaximumValueProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
VerticalAxisMinimumValueProperty
Using a DependencyProperty as the backing store for VerticalAxisMinimumValue. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty VerticalAxisMinimumValueProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
BandRange
Get and Set BandRangeProperty
Declaration
public DoubleRange BandRange { get; set; }
Property Value
Type |
---|
DoubleRange |
DataMemberPath
Get and Set DataMemberPathProperty
Declaration
public string DataMemberPath { get; set; }
Property Value
Type |
---|
System.String |
FirstPointHighlightBrush
Get and Set FirstPointHighlightBrushProperty
Declaration
public Brush FirstPointHighlightBrush { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
HighPointHighlightBrush
Get and Set HighPointHighlightBrushProperty
Declaration
public Brush HighPointHighlightBrush { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
Interior
Get and Set InteriorProperty
Declaration
public Brush Interior { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
IsEnableRangeBand
Get and Set IsEnableRangeBand
Declaration
public bool IsEnableRangeBand { get; set; }
Property Value
Type |
---|
System.Boolean |
IsFirstPointHighlighted
get and Set IsFirstPointHighlightedProperty
Declaration
public bool IsFirstPointHighlighted { get; set; }
Property Value
Type |
---|
System.Boolean |
IsHighPointHighlighted
Get and Set IsHighPointHighlightedProperty
Declaration
public bool IsHighPointHighlighted { get; set; }
Property Value
Type |
---|
System.Boolean |
IsLastPointHighlighted
Get and Set the IsLastPointHighlightedProperty
Declaration
public bool IsLastPointHighlighted { get; set; }
Property Value
Type |
---|
System.Boolean |
IsLowPointHighlighted
Get and Set the IsLowPointHighlightedProperty
Declaration
public bool IsLowPointHighlighted { get; set; }
Property Value
Type |
---|
System.Boolean |
IsMarkerEnabled
Get and Set IsMarkerEnabledProperty
Declaration
public bool IsMarkerEnabled { get; set; }
Property Value
Type |
---|
System.Boolean |
IsNegativePointsHighlighted
Get and set IsNegativePointsHighlightedProperty
Declaration
public bool IsNegativePointsHighlighted { get; set; }
Property Value
Type |
---|
System.Boolean |
ItemsSource
Get and Set ItemsSourceProperty
Declaration
public IEnumerable ItemsSource { get; set; }
Property Value
Type |
---|
System.Collections.IEnumerable |
LastPointHighlightBrush
Get and Set LastPointHighlightBrushProperty
Declaration
public Brush LastPointHighlightBrush { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
LineMarkerType
Get and Set LineMarkerTypeProperty
Declaration
public LineMarkerTypes LineMarkerType { get; set; }
Property Value
Type |
---|
LineMarkerTypes |
LowPointHighlightBrush
Get and Set LowPointHighlightBrushProperty
Declaration
public Brush LowPointHighlightBrush { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
MarkerColor
Get and Set MarkerColorProperty
Declaration
public Brush MarkerColor { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
NegativePointsHighlightBrush
Get and Set NegativePointsHighlightBrushProperty
Declaration
public Brush NegativePointsHighlightBrush { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
OriginLineStroke
Get and Set OriginLineStrokeProperty
Declaration
public Pen OriginLineStroke { get; set; }
Property Value
Type |
---|
System.Windows.Media.Pen |
RangeBandInterior
Get and Set the RangeBandInteriorProperty
Declaration
public Brush RangeBandInterior { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
ShowAxis
Get and Set ShowAxisProperty
Declaration
public bool ShowAxis { get; set; }
Property Value
Type |
---|
System.Boolean |
SparkLineType
Get and Set SparkLineTypeProperty
Declaration
public SparkLineTypes SparkLineType { get; set; }
Property Value
Type |
---|
SparkLineTypes |
Stroke
Get and Set StrokeProperty
Declaration
public Brush Stroke { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
StrokeThickness
Get and Set StrokeThicknessProperty
Declaration
public double StrokeThickness { get; set; }
Property Value
Type |
---|
System.Double |
VerticalAxisEndPointMode
Get and Set VerticalAxisEndPointModeProperty
Declaration
public AxisEndPointMode VerticalAxisEndPointMode { get; set; }
Property Value
Type |
---|
AxisEndPointMode |
VerticalAxisMaximumValue
Get and set VerticalAxisMaximumValueProperty
Declaration
public double VerticalAxisMaximumValue { get; set; }
Property Value
Type |
---|
System.Double |
VerticalAxisMinimumValue
Get and Set VerticalAxisMinimumValueProperty
Declaration
public double VerticalAxisMinimumValue { get; set; }
Property Value
Type |
---|
System.Double |
Methods
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate.
Declaration
public override void OnApplyTemplate()
OnItemsSourceChanged(DependencyObject, DependencyPropertyChangedEventArgs)
Method for Itemssource changes in Sparkline
Declaration
protected static void OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | d | |
System.Windows.DependencyPropertyChangedEventArgs | args |
OnRender(DrawingContext)
When overridden in a derived class, participates in rendering operations that are directed by the layout system. The rendering instructions for this element are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.
Declaration
protected override void OnRender(DrawingContext drawingContext)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | drawingContext | The drawing instructions for a specific element. This context is provided to the layout system. |
ValueToCoefficient(Double)
Return double value of Coefficient
Declaration
public double ValueToCoefficient(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value |
Returns
Type |
---|
System.Double |
ValueToIndex(Int32)
Return double value from int value
Declaration
public double ValueToIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type |
---|
System.Double |
ValueToPoint(Double, Int32)
Return the point value from double value
Declaration
public Point ValueToPoint(double value, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | |
System.Int32 | index |
Returns
Type |
---|
System.Windows.Point |