Skip to main content

XYSeries2D.FirstPoint Property

Specifies settings for the first series point.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v24.1.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public SidePoint FirstPoint { get; set; }

Property Value

Type Description
SidePoint

A SidePoint object that contains settings for the first series point.

Remarks

FirstPoint specifies how the chart displays the first point and its related visual elements.

The FirstPoint.LabelDisplayMode property defines how to display the point’s label.

The following values are available:

Value

Description

Default

The label uses common label settings.

DiagramEdge

The control displays the label at the diagram edge. The SidePoint.Label property specifies appearance settings.

SeriesPoint

The control shows the label next to the series point. If the label should be outside a visual area when zooming or scrolling, the label is displayed at the diagram’s edge. The SidePoint.Label property specifies appearance settings.

Use the FirstPoint.Label property to customize label’s text color, border options, text pattern, and other settings. Refer to the SeriesLabel’s Properties page for a list of available options.

You can specify how to display markers in series that support markers (for example, Line or Point). To do this, use the RangeAreaSeries2D.MarkerDisplayMode or SegmentSeries2DBase.MarkerDisplayMode property according to your series type. To show the marker on the first series point, set MarkerDisplayMode to SidePointDisplayMode.SeriesPoint. To display it on the diagram’s edge, set MarkerDisplayMode to SidePointDisplayMode.DiagramEdge.

Example

This example demonstrates how to create a template that customizes the first label’s appearance.

To show its label, set the FirstPoint.LabelDisplayMode property to SeriesPoint.

The markup below specifies the SeriesLabel.ElementTemplate and customizes the label’s appearance:

  • background color
  • text color
  • font size
  • border corner radius
  • border thickness

Set MarkerDisplayMode to SeriesPoint to display the first point marker.

Set LineSeries2D.MarkerVisible to False to hide other markers.

<Window.Resources>
    <ResourceDictionary>
        <DataTemplate x:Key="labelTemplate">
            <Border BorderThickness="1" CornerRadius="4" Opacity="1.0">
                <Border.Background>
                    <SolidColorBrush Color="DarkRed"/>
                </Border.Background>
                <Label Content="{Binding Path=Text}" Padding="2,2,2,1.5" 
        Foreground="White" FontSize="13" />
            </Border>
        </DataTemplate>
    </ResourceDictionary>
</Window.Resources>
...
<dxc:ChartControl x:Name="ChartControl1" ...>
    <dxc:XYDiagram2D>
        <dxc:SplineSeries2D Name="xSplineSeries2D" 
                            DataSource="{Binding Data}" 
                            ArgumentDataMember="Argument"
                            ValueDataMember="Value"
                            LineTension="0.8"
                            MarkerSize="15"
                            MarkerVisible="False"
                            LabelsVisibility="False">
            <dxc:SplineSeries2D.FirstPoint>
                <dxc:SidePoint LabelDisplayMode="SeriesPoint"
                            dxc:SegmentSeries2DBase.MarkerDisplayMode="SeriesPoint">
                    <dxc:SidePoint.Label>
                        <dxc:SeriesLabel  ElementTemplate="{StaticResource labelTemplate}"/>
                    </dxc:SidePoint.Label>
                </dxc:SidePoint>
            </dxc:SplineSeries2D.FirstPoint>
            ...
        </dxc:SplineSeries2D>
        ...
    </dxc:XYDiagram2D>
    ...
</dxc:ChartControl>
See Also