Skip to main content
A newer version of this page is available. .

XYDiagramSeriesViewBase.LastPoint Property

Specifies settings for the last series point.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v21.2.dll

NuGet Package: DevExpress.Charts

Declaration

[XtraChartsLocalizableCategory(XtraChartsCategory.Elements)]
public SidePoint LastPoint { get; set; }

Property Value

Type Description
SidePoint

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

Remarks

LastPoint specifies how the chart displays the last point and its related visual elements.

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

The following values are available:

Value

Description

Example

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 LastPoint.Label property to customize label’s text color, background color, border options, text pattern, and other settings. Refer to the SeriesLabelBase’s Properties page for a list of available options.

You can specify how to display markers in series that support markers (for example, Lines or Points). To do this, cast LastPoint to the SidePointMarker type.

The SidePointMarker.MarkerDisplayMode property defines how to display the marker. To show the marker on the last series point, set SidePointMarker.MarkerDisplayMode to SidePointDisplayMode.SeriesPoint. To display it on the diagram’s edge, set SidePointMarker.MarkerDisplayMode to SidePointDisplayMode.DiagramEdge.

Example

This example demonstrates how to customize the last series point.

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

The code below specifies the following label settings:

Set SidePointMarker.MarkerDisplayMode to SeriesPoint to display the last point marker. Set View.MarkerVisibility to False to hide other markers.

LineSeriesView seriesView = (LineSeriesView)chartControl1.Series[0].View;
seriesView.MarkerVisibility = DevExpress.Utils.DefaultBoolean.False;
seriesView.LastPoint.LabelDisplayMode = SidePointDisplayMode.SeriesPoint;

seriesView.LastPoint.Label.BackColor = Color.LightGray;
seriesView.LastPoint.Label.Border.Color = Color.Red;
seriesView.LastPoint.Label.Border.Thickness = 2;
seriesView.LastPoint.Label.TextColor = Color.Red;
seriesView.LastPoint.Label.TextPattern = "{V:F2}";

SidePointMarker lastPointMarker = (SidePointMarker)seriesView.LastPoint;
lastPointMarker.MarkerDisplayMode = SidePointDisplayMode.SeriesPoint;
See Also