DxChartSeriesPointImage Class

Provides image settings for points of the chart's Line series](xref:DevExpress.Blazor.DxChart`1#chart-types).

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.dll

Declaration

public class DxChartSeriesPointImage :
    DxSettingsComponent<ChartSeriesPointImageModel>

Remarks

Line series display data as points joined by line segments. Use the DxChartSeriesPointImage component to provide custom images for series points. The specified images and their settings apply to all the points in the series.

You can also handle the chart's CustomizeSeriesPoint event to override images for individual points.

The following example demonstrates how to specify point images based on WeatherType field value that comes from the chart's data source. Images with the corresponding names are stored in the wwwroot/images folder.

<DxChart Data="@WeatherForecasts" CustomizeSeriesPoint="@PreparePointImage">
    <DxChartLineSeries AggregationMethod="@(i => (int)i.Average())"
                       ValueField="@((WeatherForecast i) => i.TemperatureF)"
                       ArgumentField="@(i => i.Date.ToString("yyyy/MM/dd"))"
                       Name="Temperature, F">
        <DxChartSeriesPoint>
            <DxChartSeriesPointImage Width="50" Height="50" />
        </DxChartSeriesPoint>
    </DxChartLineSeries>
</DxChart>

@code {
    WeatherForecast[] WeatherForecasts;
    ...
    protected void PreparePointImage(ChartSeriesPointCustomizationSettings pointSettings)
    {
        IEnumerable<WeatherForecast> dataItems = pointSettings.Point.DataItems.Cast<WeatherForecast>();
        var weatherType = dataItems.GroupBy(x => x.WeatherType).OrderByDescending(x => x.Count()).First().Key;
        pointSettings.PointAppearance.Image.Url = $"images/{weatherType}.png";
    }
}

Note

Online Demo: Charts - Series Point Image

See Also