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?
Problems with custom text for series values
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |