Problems with custom text for series values

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
CT
Newbie
Newbie
Posts: 12
Joined: Fri Nov 15, 2002 12:00 am
Location: Germany
Contact:

Problems with custom text for series values

Post by CT » Mon Sep 05, 2005 12:31 pm

I got a chart with two series. One line series for data and a point series for trigger points. The point series got a own axis; marks are visible.
I want to show a custom text for the marks at the point series (AddXY(x, y, 'text') but the text should not be displayed in the bottom axis.

A simple exsample what I want to do:
Displaying the CPU Usage (line series); add a trigger (point series) every 10 seconds with a message. So far so good.

The problem: If I add a value to the point series with a custom text the time values of the line series on the bottom axis are no longer visible. Just the custom mark texts from the point series are now visible. How can i display just the normal date/time values from the line series?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Sep 05, 2005 2:47 pm

Hi CT,

The code below does something like what you request. To avoid bottom axis labels being changed, set its LabelStyle. In the example below Series1 is the line series and Series2 is the point series.

Code: Select all

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Series1.Add(random);
end;

procedure TForm1.Timer2Timer(Sender: TObject);
var
  r: double;
begin
  r:=random;
  Series2.Add(r,FloatToStr(r));
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.XValues.DateTime:=true;
  Series2.Marks.Visible:=true;
  Chart1.Axes.Bottom.LabelStyle:=talValue;
  Timer1.Interval:=100;
  Timer2.Interval:=1000;
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

CT
Newbie
Newbie
Posts: 12
Joined: Fri Nov 15, 2002 12:00 am
Location: Germany
Contact:

Post by CT » Mon Sep 05, 2005 3:20 pm

Thanks! The problem was the labelstyle. It workes great.

Post Reply