change series draw order

TeeChart for ActiveX, COM and ASP
Post Reply
corwl
Newbie
Newbie
Posts: 9
Joined: Thu Aug 09, 2007 12:00 am
Contact:

change series draw order

Post by corwl » Tue May 01, 2012 2:56 am

Hello all,

I have chart with several series.
some part of series is hidden by other series above them,
so I would like to change the drawing order of series at run-time.
How can i do it without changing series index?

best regards,
iblee

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: change series draw order

Post by Sandra » Wed May 02, 2012 9:20 am

Hello iblee,

I suggest you use property ExchangeSeries of TChart as do in next code:

Code: Select all

Private Sub Form_Load()
TChart1.AddSeries scLine
TChart1.AddSeries scLine
TChart1.Series(0).FillSampleValues
TChart1.Series(1).FillSampleValues
TChart1.ExchangeSeries 0, 1
End Sub
Can you tell us if previous code works as you want?

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

corwl
Newbie
Newbie
Posts: 9
Joined: Thu Aug 09, 2007 12:00 am
Contact:

Re: change series draw order

Post by corwl » Wed May 23, 2012 4:33 am

Thank you for your reply.

Your answer changed the order of drawing but,
changed the series index too.

In my application series index is associated with other variables so that it must maintain it's index.

Is there any solution that can change the order of drawing while maintaining series index?

regards,
iblee

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: change series draw order

Post by Yeray » Wed May 23, 2012 10:40 am

Hi iblee,

Yes, you can invert the Depth axis:

Code: Select all

TChart1.Axis.Depth.Inverted = True
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

corwl
Newbie
Newbie
Posts: 9
Joined: Thu Aug 09, 2007 12:00 am
Contact:

Re: change series draw order

Post by corwl » Fri May 25, 2012 8:55 am

Hi Yeray

I am really appreciate your help.

In my chart, many series are overlapped and I want one arbitrary series to be drawn on the top.

Can drawing order be controlled in arbitrary way?

Best regards
iblee

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: change series draw order

Post by Yeray » Fri May 25, 2012 9:25 am

Hi iblee,

I'm afraid not.
The only possibilities I see are the suggested above. Concretelly, regarding the first suggestion about using ExchangeSeries to sort your series as you wish, you said:
corwl wrote:In my application series index is associated with other variables so that it must maintain it's index.
I guess you could add some logic to maintain a table of indexes to maintain your relations.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply