Dash line appearing as straight line
Dash line appearing as straight line
Hi,
In the editor I set the style of a line series to dash lines but in the report where the chart is printed it always appears as a straight line. Any idea why this is happening?
Regards,
Vincenzo
P.S. Cannot attache screen-shots as an error message appears saying the board quota has been reached.
In the editor I set the style of a line series to dash lines but in the report where the chart is printed it always appears as a straight line. Any idea why this is happening?
Regards,
Vincenzo
P.S. Cannot attache screen-shots as an error message appears saying the board quota has been reached.
Re: Dash line appearing as straight line
Which version of Delphi and TeeChart are you using?
Re: Dash line appearing as straight line
Delphi 2009 and TeeChart Pro V.8.04.11395 Win32
Re: Dash line appearing as straight line
Hm, I don't have version 8 but I know that 8.04 is not the latest release. My suggestion is to install 8.08 and see if the problem persists.
Re: Dash line appearing as straight line
Hello,
Yes, please try it with the latest release available at the client area and, if the problem persists, please tell us what reporting component are you using and try to arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.
Yes, please try it with the latest release available at the client area and, if the problem persists, please tell us what reporting component are you using and try to arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Dash line appearing as straight line
Hi,
Thanks for your replies. It's not crucial for me to have a dashed line and installing the latest version just to try it out is too much hassle (have to re-install my current version again later).
Regards,
Vincenzo
Thanks for your replies. It's not crucial for me to have a dashed line and installing the latest version just to try it out is too much hassle (have to re-install my current version again later).
Regards,
Vincenzo
Re: Dash line appearing as straight line
Hello Vincenzo,
I understand it's not a critical problem but we'll be pleased to take a look at it if we can reproduce it here. But to do so, we'd need to know what reporting component are you using and it would be also really helpful if we could have a simple example project we can run as-is to reproduce the problem here.
I understand it's not a critical problem but we'll be pleased to take a look at it if we can reproduce it here. But to do so, we'd need to know what reporting component are you using and it would be also really helpful if we could have a simple example project we can run as-is to reproduce the problem here.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Dash line appearing as straight line
Hi Alonso,
Meanwhile I found out that it has nothing to do with the report component. The line is shown as straight line (instead of dashed) if the vertical axis assigned is the right one (if it's the left it's drawn correctly as dashed). I have created a small example program if you need it, where can I upload it?
Regards,
Vincenzo
Meanwhile I found out that it has nothing to do with the report component. The line is shown as straight line (instead of dashed) if the vertical axis assigned is the right one (if it's the left it's drawn correctly as dashed). I have created a small example program if you need it, where can I upload it?
Regards,
Vincenzo
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Dash line appearing as straight line
Hi Vincenzo,
You can attach files to this forums board in your replies. You can compress your project in a zip packages and attach it to your reply.
Thanks in advance.
You can attach files to this forums board in your replies. You can compress your project in a zip packages and attach it to your reply.
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 |
Re: Dash line appearing as straight line
Sample program attached.
- Attachments
-
- test2.zip
- (14.3 KiB) Downloaded 768 times
Re: Dash line appearing as straight line
Hello Vincenzo,
The problem here is that the distance between each two points isn't enough for the Dash pen style to be noticed. Note that the line series is drawn in segments.
Here you have an example:
An option would be to use psDot style instead of psDash.
Find here a more complete explanation of it.
The problem here is that the distance between each two points isn't enough for the Dash pen style to be noticed. Note that the line series is drawn in segments.
Here you have an example:
Code: Select all
uses Chart, Series;
var Chart1: TChart;
Series1: TLineSeries;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1:=TChart.Create(Self);
Chart1.Parent:=Self;
Chart1.Color:=clWhite;
Chart1.View3D:=false;
Chart1.Legend.Visible:=false;
Chart1.Axes.Bottom.Grid.Visible:=false;
Chart1.Axes.Left.Grid.Visible:=false;
Series1:=Chart1.AddSeries(TLineSeries) as TLineSeries;
Series1.Pen.Style:=psDash;
for i := 0 to 10 do
Series1.Add(12+i);
//Series1.Pointer.Visible:=true;
Chart1.Axes.Bottom.SetMinMax(0, 20);
Chart1.Axes.Left.SetMinMax(10, 22);
Chart1.Draw;
end;
procedure TForm1.FormPaint(Sender: TObject);
var YDispl, XDispl, i: Integer;
begin
YDispl:=300;
XDispl:=50;
with Self.Canvas do
begin
Pen.Style:=psDash;
MoveTo(Series1.CalcXPos(0),Series1.CalcYPos(0)+YDispl);
LineTo(Series1.CalcXPos(Series1.Count-1),Series1.CalcYPos(Series1.Count-1)+YDispl);
for i:=0 to Chart1[0].Count-2 do
begin
MoveTo(Series1.CalcXPos(i)+XDispl, Series1.CalcYPos(i)+YDispl);
LineTo(Series1.CalcXPos(i+1)+XDispl, Series1.CalcYPos(i+1)+YDispl);
end;
end;
end;
Find here a more complete explanation of it.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Dash line appearing as straight line
Hi,
Thanks for investigating this, I do understand the explanation but nevertheless it would be good if Teechart would automatically convert to dot (or shorter lines) if dashes cannot be drawn.
Regards,
Vincenzo
Thanks for investigating this, I do understand the explanation but nevertheless it would be good if Teechart would automatically convert to dot (or shorter lines) if dashes cannot be drawn.
Regards,
Vincenzo
Re: Dash line appearing as straight line
Hi Vincenzo,
TeeChart could include it (or better, the option to check it or not, for not to break backwards compatibility) but it would mean many new conditions (one for each segment to be drawn) so it could affect the performance even for those who use psSolid but have thousands of points.
So I'd suggest you to check it in your code. The following works for me here:
TeeChart could include it (or better, the option to check it or not, for not to break backwards compatibility) but it would mean many new conditions (one for each segment to be drawn) so it could affect the performance even for those who use psSolid but have thousands of points.
So I'd suggest you to check it in your code. The following works for me here:
Code: Select all
uses Chart, Series, TeCanvas;
var Chart1: TChart;
Series1: TLineSeries;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
d: double;
begin
Chart1:=TChart.Create(Self);
Chart1.Parent:=Self;
Chart1.Color:=clWhite;
Chart1.View3D:=false;
Chart1.Legend.Visible:=false;
Chart1.Axes.Bottom.Grid.Visible:=false;
Chart1.Axes.Left.Grid.Visible:=false;
Series1:=Chart1.AddSeries(TLineSeries) as TLineSeries;
Series1.Pen.Style:=psDash;
for i := 0 to 10 do
Series1.Add(12+i);
Chart1.Axes.Bottom.SetMinMax(0, 20);
Chart1.Axes.Left.SetMinMax(10, 22);
if Series1.Pen.Style=psDash then
for i:=0 to Series1.Count-2 do
begin
d:=TeeDistance(Series1.CalcXPos(i+1)-Series1.CalcXPos(i),Series1.CalcYPos(i+1)-Series1.CalcYPos(i));
if (d < 25) then
begin
Series1.Pen.Style:=psDot;
exit;
end;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Dash line appearing as straight line
Hi,
Thanks for the code sample and I understand that for performance reasons it wouldn't be a good idea to include the automatic switch.
Regards,
Vincenzo
Thanks for the code sample and I understand that for performance reasons it wouldn't be a good idea to include the automatic switch.
Regards,
Vincenzo
-
- Newbie
- Posts: 12
- Joined: Mon Jan 17, 2011 12:00 am
Re: Dash line appearing as straight line
Hello,
in my TeeChart project (using TeeChart 2010 and Delphi 2010) I found the same problem as discussed in these posts/replys. However, I observed that this problem seems to be somewhat more general: even a dot-style series "melts" into a solid line if the number of points per page exceeds a certain level (Zooming such a line would restore the dot style).
The chart applications that I am developing with TeeChart, usually contain more than 5 line series within the chart. Of course, to distinguish them from each other it is necessary to use not only different colors but also different styles (solid, dash, dot...).
So, in my opinion the pen style appearance of a series should not be affected by the number of series points, although I can imagine that handling this won't be an easy job for the component developers
Do you see any chance, to solve this problem in one of the next releases?
Regards,
Andreas
in my TeeChart project (using TeeChart 2010 and Delphi 2010) I found the same problem as discussed in these posts/replys. However, I observed that this problem seems to be somewhat more general: even a dot-style series "melts" into a solid line if the number of points per page exceeds a certain level (Zooming such a line would restore the dot style).
The chart applications that I am developing with TeeChart, usually contain more than 5 line series within the chart. Of course, to distinguish them from each other it is necessary to use not only different colors but also different styles (solid, dash, dot...).
So, in my opinion the pen style appearance of a series should not be affected by the number of series points, although I can imagine that handling this won't be an easy job for the component developers
Do you see any chance, to solve this problem in one of the next releases?
Regards,
Andreas