Page 1 of 1

change series draw order

Posted: Tue May 01, 2012 2:56 am
by 15046375
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

Re: change series draw order

Posted: Wed May 02, 2012 9:20 am
by 10050769
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,

Re: change series draw order

Posted: Wed May 23, 2012 4:33 am
by 15046375
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

Re: change series draw order

Posted: Wed May 23, 2012 10:40 am
by yeray
Hi iblee,

Yes, you can invert the Depth axis:

Code: Select all

TChart1.Axis.Depth.Inverted = True

Re: change series draw order

Posted: Fri May 25, 2012 8:55 am
by 15046375
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

Re: change series draw order

Posted: Fri May 25, 2012 9:25 am
by yeray
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.