Page 1 of 1

Problems with custom text for series values

Posted: Mon Sep 05, 2005 12:31 pm
by 8439897
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?

Posted: Mon Sep 05, 2005 2:47 pm
by narcis
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;

Posted: Mon Sep 05, 2005 3:20 pm
by 8439897
Thanks! The problem was the labelstyle. It workes great.