Page 1 of 1

Bottom Axis Labels not appearing.

Posted: Thu Jun 21, 2007 9:30 am
by 9350100
Hi
If you have more than two time based series data and there is data lacking from the second series and second point then the label of the date does not appear on the bottom axis. I have some sample code illustrating this. The point are plotted fine on the graph it is just the label that does not appear; in some cases you can fix this by exchanging the order of the series but then the first series has to have all the date series data, otherwise the label does not display. It seems like the routine to display the label only uses the first series (my guess).

Posted: Thu Jun 21, 2007 10:49 am
by narcis
Hi Hanodl,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Fri Jun 22, 2007 10:26 am
by yeray
Hi Hanodl,

First of all note that by default only the labels from the first series will be shown at the bottom axis. Points from other series with x values non-existing in the first series won't have their labels displayed.

We've tested your project and noticed that you enter your X values using an integer called NextCounter and then you assign a label to some of those points introduced. So the points (from series which aren't the first series with labels) will be shown without label associated.

At this point you have two options to achieve displaying labels for all your series:

1) Entering your points using the timedata as X value and not as label and force Bottom axis to show X values. You can do something as follows:

Code: Select all

ActiveLineSeries.Active := True;
                 ActiveLineSeries.XValues.DateTime:=true;
                 OSTGChart.Axes.Bottom.LabelStyle:=talValue;
                 ActiveLineSeries.AddXY(SampleTrendLocalQ.FieldByName('sample_date').AsDateTime,
                           //NextCounter,
                           SampleTrendLocalQ.FieldByName('number_value').Value,'',clTeeColor);
2) Using axes custom labels as you can see in the new features demo, available at Teechart program group. The example is at All Features -> Axes -> Labels -> Custom Labels.