Page 1 of 1

Leading Null with PointLabel trashes x-axis

Posted: Thu Nov 25, 2004 6:09 am
by 9083274
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?

Posted: Thu Nov 25, 2004 2:23 pm
by Pep
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

Posted: Fri Nov 26, 2004 1:25 am
by 9083274
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

Posted: Fri Nov 26, 2004 8:31 am
by Pep
Hi Mike,

ok, I'm glad to hear this..