Page 1 of 1

Point in time events

Posted: Tue May 01, 2007 11:37 am
by 9348284
Hi all,

being a TeeChart newbie, I'm not sure how to solve this one:

I have a Chart with a number of TLineSeries representing data logged at a given interval. The X-axis represents time obviously.
Asynchronus to this logging, some events might happen that should be represented on the same X-axis. The text describing the event could be a hint when the mouse hovers over each point, or even printed next to the points.
I tried adding a TPointSeries, where I can add events at different X-values (times), but this approach has (at least) two backsides:
1) I would like to avoid the events-series to show up in the legend.
2) The Label added with TPointSeries.AddXY(Time, 0, 'Label') is put on the X-axis instead of the date/time info that used to be there.

Any ideas ?

TIA

Søren

Posted: Wed May 02, 2007 11:36 am
by narcis
Hi Søren,
1) I would like to avoid the events-series to show up in the legend.
This can be easily solved using this:

Code: Select all

  Series1.ShowInLegend:=false;
2) The Label added with TPointSeries.AddXY(Time, 0, 'Label') is put on the X-axis instead of the date/time info that used to be there.


Try forcing your bottom axis to display series values using this:

Code: Select all

  Chart1.Axes.Bottom.LabelStyle:=talValue;

Posted: Wed May 02, 2007 11:45 am
by 9348284
Hi Narcis

Thanks a lot for your quick response, that worked fine. :D

Do you have a suggestion for showing the label text (which is now showed as a tip) next to the point, or would that be annotations ?

/Søren

Posted: Wed May 02, 2007 12:08 pm
by narcis
Hi Søren,

Have you tried making series marks visible?

Code: Select all

  Series1.Marks.Visible:=true;

Posted: Wed May 02, 2007 12:30 pm
by 9348284
Hi Narcis,

Yes, that shows the marks (obviously - stupid me).
But the mark text then hides the point, can i offset it relative to the point?

Best
Søren

Posted: Wed May 02, 2007 1:11 pm
by narcis
Hi Søren,

Yes, this can be done setting arrow's length:

Code: Select all

  Series1.Marks.ArrowLength:=20; 
Notice that negative values for ArrowLength are also supported.

Or another option is setting custom marks position as shown here.

Posted: Wed May 02, 2007 1:47 pm
by 9348284
Thank you VERY much Narcis

Kind regards

Søren