Back to Devexpress

IChartSeriesLabelConnector.Color Property

blazor-devexpress-dot-blazor-dot-ichartserieslabelconnector.md

latest2.4 KB
Original Source

IChartSeriesLabelConnector.Color Property

Specifies the label connector’s color.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
Color Color { get; set; }

Property Value

TypeDescription
Color

The color.

|

Remarks

The following code snippet makes point labels and their connectors red.

razor
<DxChart Data="@WeatherForecasts" CustomizeSeriesPoint="@PreparePointLabel">
    <DxChartLineSeries SummaryMethod="@(i => (int)i.Average())"
                       ValueField="@((WeatherForecast i) => i.TemperatureF)"
                       ArgumentField="@(i => i.Date.Date)"
                       Name="Temperature, F">
        <DxChartSeriesLabel Position="RelativePosition.Outside">
            <DxChartSeriesLabelConnector Visible="true" />
        </DxChartSeriesLabel>
    </DxChartLineSeries>
    <DxChartLegend Position="RelativePosition.Outside" />
</DxChart>

@code {
    WeatherForecast[] WeatherForecasts;
    ...
    protected void PreparePointLabel(ChartSeriesPointCustomizationSettings pointSettings) {
        double value = (double)pointSettings.Point.Value;
        if (value > 25 && value < 75) {
            pointSettings.PointLabel.Visible = true;
            pointSettings.PointLabel.BackgroundColor = System.Drawing.Color.Red;

            pointSettings.PointLabel.Connector.Width = 5;
            pointSettings.PointLabel.Connector.Color = System.Drawing.Color.Red;
        }
    }
}

To specify a point label’s background color, use the BackgroundColor property.

Run Demo: Charts - Series Label Customization

See Also

IChartSeriesLabelConnector Interface

IChartSeriesLabelConnector Members

DevExpress.Blazor Namespace