Page 1 of 1

Ignoring Null Points in High-Low Series

Posted: Mon Oct 08, 2007 8:05 am
by 15046925
Hi,

I have the following situation :

I have a set of data which is valid only for certain interval of a series, i.e.

1-3-5
2-4-8
3-6-5
-no points-
8-6-12
9-3-14
...

I would like to represent this data as a High-Low graph, while ignoring the null values, i.e. i would like nothing to be drawn between the point at 3 and the point at 8.

If I draw the data as two different line series, I can set the ILineSeries.TreatNulls property to tnSkip and I obtain the desired effect.

However there seems to be no such property in the IHighLowSeries (unless I am missing something).

I would also like to avoid creating multiple series (i.e. one high-low series from 1 to 3 and one high-low series from 8 to 9) for the following reason : If the graph is composed of multiple series, these will depend of the data and new series can be added (or removed) depending on data changes. It is thus quite hard for the user to configure the series appearance in a generic way as it is data-dependent.

Is there a way i can obtain the TreatNulls=tnSkip effect in a High-Low graph (or at least emulate it) without having multiple series ?

Thanks in advance for your answers

- Alexandre -

Posted: Mon Oct 08, 2007 9:18 am
by narcis
Hi Alexandre,

Yes, this is already possible adding a null value where you don't want the series being painted, for example:

Code: Select all

    TChart1.Series(0).asHighLow.AddHighLow 1, 3, 5, "", clTeeColor
    TChart1.Series(0).asHighLow.AddHighLow 2, 4, 8, "", clTeeColor
    TChart1.Series(0).asHighLow.AddHighLow 3, 6, 5, "", clTeeColor
    TChart1.Series(0).AddNull ""
    TChart1.Series(0).asHighLow.AddHighLow 8, 6, 12, "", clTeeColor
    TChart1.Series(0).asHighLow.AddHighLow 9, 3, 14, "", clTeeColor

Posted: Mon Oct 08, 2007 10:18 am
by 15046925
Hi,

Thanks for the quick answer.

I have one more question.

I am in fact giving the data to the series using an ADO record set. I then set the value source of HighValues and LowValues

My question is the following : Am i correct in assuming that I can use the AddNullXY function to add a null once the data source has been set ?

Code: Select all

' RecordSet contains the data in my previous mail
TChart1.Series(0).DataSource = RecordSet
TChart1.Series(0).asHighLow.HighValues.ValueSource = "A"
TChart1.Series(0).asHighLow.LowValues.ValueSource = "B"
TChart1.Series(0).AddNullXY 4, 0, ""
Will this code produce the same effect as the snippet you sent in your post ?

Thanks again for your answer

- Alexandre -

Posted: Mon Oct 08, 2007 10:45 am
by narcis
Hi Alexandre,

Yes it should. Any version/override of the add method just adds this value to existing values in the series.