Skip to main content Skip to footer

Display a Text Label on the Last Data Point

You can use an Annotation to add a text label to the last data point.

private void FlexChart_Rendering(object sender, C1.WPF.Chart.RenderEventArgs e)
{
    if (chart.AxisX.Max < textAnnotation.Location.X)
    {
        textAnnotation.Location = new Point(chart.AxisX.Max - 12, textAnnotation.Location.Y);
    }
    else
    {
        textAnnotation.Location = (series1.ItemsSource as PointCollection).Last();
    }
}

If the last data point is moved off screen and you want the Annotation to remain visible, you can use this code:

private void Hide_LastIndex(object sender, RoutedEventArgs e)
{
    chart.AxisX.Max = 140;
}

private void Show_LastIndex(object sender, RoutedEventArgs e)
{
    chart.AxisX.Max = 200;
}