Hi,
I have created a chart, TeeChart 7.02, drawing 2 TLineSeries, each line is about 2000 points. One of them needs to be dotted or dashed style. When setting TLinePen to dotted (small dots True), you don't see a dotted line because the dots are drawn between points. And with 2000 points in a trace, you don't see them. That is obvious. However, I need to have this one line dotted, without reducing points. I have done it now by using AddNullXY every .. points, but I assume there must be an easy way to get a dotted line right away, no matter how many points are in the trace?
Thanks in advance,
Davy
Drawing a dotted line
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Davy,
Using v7.04 (latest version available at our customer download area) and the code below you can cleary see Series2 being small-dotted.
If you don't succedd on this could you please send us an example we can run "as-is" to reproduce the problem here?
You can post your examples at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
Using v7.04 (latest version available at our customer download area) and the code below you can cleary see Series2 being small-dotted.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues(2000);
Series2.FillSampleValues(2000);
Series2.Pen.SmallDots:=true;
end;
You can post your examples at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
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 |
Hi Narcis,
Have tried your code with 7.04 and that works well indeed.
My code is a bit different as you might assume
Note when zooming in you see a dotted line between points.
Any clue?
Thanks a lot for your efforts,
Davy
Have tried your code with 7.04 and that works well indeed.
My code is a bit different as you might assume
Note when zooming in you see a dotted line between points.
Code: Select all
procedure TForm1.Button2Click(Sender: TObject);
// This code does not draw a dotted line
var
i: integer;
j: double;
begin
for i := 0 to Chart1.SeriesCount - 1 do
Chart1.Series[i].Clear;
j := 0;
for i := 0 to 1999 do
begin
Series1.AddXY(i,j);
Series2.AddXY(i,j + 50);
j := j + 0.2;
// j := j + 1; // Makes no difference
end;
Series2.Pen.SmallDots := True;
end;
Thanks a lot for your efforts,
Davy
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Davy,
I can reproduce the problem with your code. It happens because your points are very close one to another. You could try using another pen style as dots, for example, and increase its size. However it won't work because it will end making a thick line.
Depending on how are your points distributed you can play a little with pen styles and sizes to see if there's a combination that fits your needs.
I can reproduce the problem with your code. It happens because your points are very close one to another. You could try using another pen style as dots, for example, and increase its size. However it won't work because it will end making a thick line.
Depending on how are your points distributed you can play a little with pen styles and sizes to see if there's a combination that fits your needs.
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 |
Hi Narcis,
Playing around with pen styles and so on does not makes any sense in this application. Infact, the graph is used as a sweepchart with a pre-defined no of points, where every 200 ms a point is overwritten with a new one, so the graph cycles around every 2000 / 5 = 400 seconds. It is an data acquisition application. If I reduce points, customer information gets lost.
I think it is a bit of un-intended behavior of the chart, because FillSampleValues does what it should do. Could Steema address this please?
Kind regards,
Davy
Playing around with pen styles and so on does not makes any sense in this application. Infact, the graph is used as a sweepchart with a pre-defined no of points, where every 200 ms a point is overwritten with a new one, so the graph cycles around every 2000 / 5 = 400 seconds. It is an data acquisition application. If I reduce points, customer information gets lost.
I think it is a bit of un-intended behavior of the chart, because FillSampleValues does what it should do. Could Steema address this please?
Kind regards,
Davy
Hi Davy,
A solution for this problem could be using TFastLineSeries instead of TLineSeries.
FillSampleValues works in the same manner, but it normally does not reproduce a straight line. If you modify the following lines in your code you will see the same as using FillSampleValues :I think it is a bit of un-intended behavior of the chart, because FillSampleValues does what it should do. Could Steema address this please?
Code: Select all
for i := 0 to 1999 do
begin
Series1.AddXY(i,j);
Series2.AddXY(i,Random(350) + 50);
j := j + 0.2;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com