I want to display the value in a line chart for only the last data point.
So far, I've discovered the TChart_SalesAndBacklog_OnGetSeriesMark event, but how do I identify the FINAL data point so I can set the MarkText for it?
OR, is there a better way to do what I'm trying to accomplish?
How to identify the LAST point in a line chart?
Re: How to identify the LAST point in a line chart?
Hello kaprice,
I have made a simple code where I have identified the last data point using the LastValueIndex Series property.
Could you tell us if previous code works in your end?
Thanks,
I have made a simple code where I have identified the last data point using the LastValueIndex Series property.
Code: Select all
Private Sub Form_Load()
TChart1.AddSeries scLine
TChart1.Series(0).FillSampleValues
TChart1.Aspect.View3D = False
TChart1.Series(0).Marks.Visible = True
End Sub
Private Sub TChart1_OnGetSeriesMark(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, MarkText As String)
If ValueIndex = TChart1.Series(SeriesIndex).LastValueIndex Then
TChart1.Series(SeriesIndex).Marks.Item(ValueIndex).Visible = True
Else
TChart1.Series(SeriesIndex).Marks.Item(ValueIndex).Visible = False
End If
End Sub
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |