TeeChart Pro6....Problem with vertical line...
TeeChart Pro6....Problem with vertical line...
Hello Experts!!
I draw a line in the middle of a TeeChart like this at design-time (Axis --> Scaling: half step of the MIN-MAX-difference ...)
I capture data from a sensor at realtime and want to show this data in the chart. But at runtime the labels of the bottom-axis and also the vertical line in the middle disappear like this...
David Berneda recommended me to try a vertical line like this....
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var Middle : Integer;
begin
Middle:=(Chart1.BottomAxis.IStartPos+Chart1.BottomAxis.IEndPos) div 2;
Chart1.Canvas.DoVertLine(Middle,Chart1.LeftAxis.IStartPos,Chart1.LeftAxis.IEndPos);
end;
But this line never appear at runtime!!
What do I make wrong??
Bye
Thomas
I draw a line in the middle of a TeeChart like this at design-time (Axis --> Scaling: half step of the MIN-MAX-difference ...)
I capture data from a sensor at realtime and want to show this data in the chart. But at runtime the labels of the bottom-axis and also the vertical line in the middle disappear like this...
David Berneda recommended me to try a vertical line like this....
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var Middle : Integer;
begin
Middle:=(Chart1.BottomAxis.IStartPos+Chart1.BottomAxis.IEndPos) div 2;
Chart1.Canvas.DoVertLine(Middle,Chart1.LeftAxis.IStartPos,Chart1.LeftAxis.IEndPos);
end;
But this line never appear at runtime!!
What do I make wrong??
Bye
Thomas
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Thomas,
It works fine for me here using this code:
Could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
It works fine for me here using this code:
Code: Select all
procedure TForm8.Chart1AfterDraw(Sender: TObject);
var Middle : Integer;
begin
Middle:=(Chart1.BottomAxis.IStartPos+Chart1.BottomAxis.IEndPos) div 2;
Chart1.Canvas.DoVertLine(Middle,Chart1.LeftAxis.IStartPos,Chart1.LeftAxis.IEndPos);
end;
procedure TForm8.Timer1Timer(Sender: TObject);
begin
Series1.Add(random*100);
end;
Thanks in advance.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Thomas,
I'm not able to guess which can be the problem without being able to reproduce the problem here. You can try using the code below. It could be that labels overlap and are not displayed. The line below would force them being drawn.
If the problem persists please try to arrange a simple example with random or manually added data we can run "as-is" to reproduce the problem here.
Thanks in advance.
I'm not able to guess which can be the problem without being able to reproduce the problem here. You can try using the code below. It could be that labels overlap and are not displayed. The line below would force them being drawn.
Code: Select all
Chart1.BottomAxis.LabelsSeparation:=0;
Thanks in advance.
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 |
Hello Narcis!!
I'm on the way to solve my problem...what I found out is very simple:
I draw a black vertical line on a black background....*great shame*
I have 2 little questions they could help on:
+) Can I paint the vertical drawn line in other colors?? So that I have a green or red vertical line in the middle??
+) Can you give me a little code snip how to use TDateTime on the X-Axis?? (I want the format 'nn:ss')...
Bye
Thomas
I'm on the way to solve my problem...what I found out is very simple:
I draw a black vertical line on a black background....*great shame*
I have 2 little questions they could help on:
+) Can I paint the vertical drawn line in other colors?? So that I have a green or red vertical line in the middle??
+) Can you give me a little code snip how to use TDateTime on the X-Axis?? (I want the format 'nn:ss')...
Bye
Thomas
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi bingo72,
Yes, you need to set canvas pen's color an width:
Yes, you need to set canvas pen's color an width:
Code: Select all
procedure TForm8.Chart1AfterDraw(Sender: TObject);
var Middle : Integer;
begin
Middle:=(Chart1.BottomAxis.IStartPos+Chart1.BottomAxis.IEndPos) div 2;
With Chart1.Canvas do
begin
Pen.Color:=clGreen;
Pen.Width:=5;
DoVertLine(Middle,Chart1.LeftAxis.IStartPos,Chart1.LeftAxis.IEndPos);
end;
end;
procedure TForm8.FormCreate(Sender: TObject);
begin
Series1.XValues.DateTime:=true;
Chart1.Axes.Bottom.DateTimeFormat:='ss:nn';
end;
procedure TForm8.Timer1Timer(Sender: TObject);
begin
Series1.AddXY(now,random*100);
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 |