Leading Null with PointLabel trashes x-axis

TeeChart for ActiveX, COM and ASP
Post Reply
IndustrialMike
Newbie
Newbie
Posts: 4
Joined: Tue Jul 27, 2004 4:00 am
Location: Western Australia

Leading Null with PointLabel trashes x-axis

Post by IndustrialMike » Thu Nov 25, 2004 6:09 am

I've got Teechart 6.0.0.5. I plot my data using a line series with timestamps on the X-axis. When I encounter some null data in my source, I use AddNullXY with some explanatory text as the 3rd parameter, i.e.

Series(0).AddNullXY datestamp, value, "errorText"

Sometimes my data STARTS with a null. When I plot such data, the entire X-axis scale disappears! I see my label text near the origin of the X axis, but the X-axis scale is completely blank apart from that.

The line draws normally, I just have no timestamps along the X-axis.

Some investigation has shown that this corruption is caused by the label being passed to the AddNullXY method. I.e. if my initial AddNullXY call contains an empty string as the 3rd parameter, then the X-axis scale is drawn correctly.

Omitting the label is not an option. Can Steema help here?

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

Post by Pep » Thu Nov 25, 2004 2:23 pm

Hi,

to be able to show the labels you enter for the Null points and the DateTime values of the rest of the Points one way could be setting the Axis labels style to talText and also add the DateTime values as labels, i .e :
.Series(0).XValues.DateTime = True
.Series(0).AddNullXY Now, 0, "Error"
.Series(0).AddXY Now + 1, 10, DateValue(Now + 1), clTeeColor
.Axis.Bottom.Labels.Style = talText

IndustrialMike
Newbie
Newbie
Posts: 4
Joined: Tue Jul 27, 2004 4:00 am
Location: Western Australia

Post by IndustrialMike » Fri Nov 26, 2004 1:25 am

Solved: My goal was not to display the point labels and dates simultaneously, but to ensure that dates were displayed consistently regardless of the presence or absence of point labels.

It looks like the style-guessing algorithm implied by talAuto was my problem. When I overrode this with
.Axis.Bottom.Labels.Style = 2 '2=talValue
then I got the dates all the time, which is what I was after. So thanks for the pointer in the right direction.

Regards,
Mike

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

Post by Pep » Fri Nov 26, 2004 8:31 am

Hi Mike,

ok, I'm glad to hear this..

Post Reply