Interface IChartDataPoint
Represents chart point interface that any chart point should implement.
Inherited Members
Namespace: Syncfusion.Windows.Chart
Assembly: Syncfusion.Chart.Wpf.dll
Syntax
public interface IChartDataPoint : ICloneable, IDisposable
Remarks
Interface defines methods and properties that are required for proper chart building.
Examples
This sample demonstrates how interface can be implemented: C#:
class CustomPoint : IChartDataPoint
{
public CustomPoint(double X, double Y)
{
this.X = X;
this.Y = Y;
this.Values = new double[] {Y};
}
public double X {get; set;}
public double Y {get; set;}
public double[] Values {get; set;}
public bool IsEmpty {get; set;}
public bool Visible {get; set;}
public ChartSegment ParentSegment {get; set;}
public object Item {get; set;}
public object Clone()
{
CustomPoint customPoint = new CustomPoint(this.X, this.Y);
//...
// Filling proper fields.
//...
return customPoint;
}
}
// Custom collection strongly typed as CustomPoint that implements IChartData.
class CustomChartPointsCollection : ObservableCollection <CustomPoint>,
IChartData
{
public new IChartDataPoint this[int index]
{
get { return base[index]; }
}
public ChartValueType XValueType { get; set; }
}
//Using classes
//...
//Creating a new chart1 with area and series.
//...
CustomChartPointsCollection customCollection = new
CustomChartPointsCollection();
customCollection.Add(new CustomPoint(1, 3));
customCollection.Add(new CustomPoint(2, 5));
customCollection.Add(new CustomPoint(3, 2));
customCollection.Add(new CustomPoint(4, 8));
chart1.Areas[0].Series[0].Data = customCollection;
XAML:
This type is not intended to be used from XAML.
Properties
EmptyPoint
Gets or sets a value indicating whether empty point.
Declaration
bool EmptyPoint { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsEmpty
Gets a value indicating whether this point is empty.
Declaration
bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Item
Gets or sets the item that point represents. Item could be ether X,Y of custom value.
Declaration
object Item { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The item that point represent. |
Label
Gets or sets label for point.
Declaration
string Label { get; set; }
Property Value
Type |
---|
System.String |
ParentSegment
Gets or sets the parent segment.
Declaration
ChartSegment ParentSegment { get; set; }
Property Value
Type | Description |
---|---|
ChartSegment | The parent segment ChartSegment. |
Remarks
Parent segment for point should be set in order to provide user with ability to disable certain points on series.
Should not use this property if dynamic points hiding is not required.
StringItem
Get or Sets the StringItem that point represents
Declaration
object StringItem { get; set; }
Property Value
Type |
---|
System.Object |
Tag
Gets or sets the Tag that point represents.
Declaration
object Tag { get; set; }
Property Value
Type |
---|
System.Object |
Values
Gets or sets the point values.
Declaration
double[] Values { get; set; }
Property Value
Type | Description |
---|---|
System.Double[] | The values. |
Remarks
Values array should be used to represent range of Y values that correspond to one X value.
Visible
Gets or sets a value indicating whether this IChartDataPoint is visible.
Declaration
bool Visible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
X
Gets or sets the X point value.
Declaration
double X { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The X value. |
Y
Gets or sets the Y point value.
Declaration
double Y { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The Y value. |