Delete Series Event

TeeChart for ActiveX, COM and ASP
Post Reply
GLSWG
Newbie
Newbie
Posts: 39
Joined: Fri Jan 09, 2004 5:00 am

Delete Series Event

Post by GLSWG » Mon Oct 25, 2004 1:49 pm

Hi,

I'm aware that there's no such event in TChart. All I need to know is what series (indexes) are left after deletion. I tried to use

Code: Select all

OnSeriesAfterDrawValuesTchart(long SeriesIndex) 
but it showed incorrect indexes. Example, I was having three series with indexes 0,1,2. After I deleted serie 1, it showed two series left with indexes 0 and 1. But it should be 0,2.

At least if I open Chart Editor it displays there Series<b>0</b> and Series<b>2</b>, while in OnSeriesAfterDrawValuesTchart it says indexes <b>0</b> and <b>1</b>

I'm using VC++ 6.0 and ActiveX 6
Please, let me know how I can achieve this. Thank you in advance.

Michael.

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Oct 27, 2004 8:23 am

Hi Michael,
but it showed incorrect indexes. Example, I was having three series with indexes 0,1,2. After I deleted serie 1, it showed two series left with indexes 0 and 1. But it should be 0,2.
This is correct, because it's a list. You can use the ISeries.Name property to delete Series. This property is a read/write property available to the ISeries interface:

Code: Select all

Private Sub Command1_Click()
With TChart1
    .RemoveSeries zero
    MsgBox .Series(.SeriesCount - 1).Name
End With
End Sub
You could also store and update the Series Names and their indexes when a Serie removed.

Post Reply