Back to Devexpress

SeriesPoint.Color Property

corelibraries-devexpress-dot-xtracharts-dot-seriespoint-47b7e040.md

latest2.0 KB
Original Source

SeriesPoint.Color Property

Gets or sets the color used to draw this point.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public Color Color { get; set; }
vb
Public Property Color As Color

Property Value

TypeDescription
Color

A Color object.

|

Remarks

You can also use series point colorizers to paint series points.

Examples

The following example shows how to paint all the points with values less than 80 with the Red color:

csharp
chartControl1.BoundDataChanged += OnChartBoundDataChanged;
// ...
private void OnChartBoundDataChanged(object sender, EventArgs e) {       
    foreach (SeriesPoint seriesPoint in chartControl1.Series[0].Points) {
       if (seriesPoint.Values[0] <= 80) {
            seriesPoint.Color = Color.Red;
        }
    }
}
vb
chartControl1.BoundDataChanged += OnChartBoundDataChanged
' ...
Private Sub OnChartBoundDataChanged(ByVal sender As Object, ByVal e As EventArgs)
    For Each seriesPoint As SeriesPoint In chartControl1.Series(0).Points

        If seriesPoint.Values(0) <= 80 Then
            seriesPoint.Color = Color.Red
        End If
    Next
End Sub

See Also

SeriesPoint Class

SeriesPoint Members

DevExpress.XtraCharts Namespace