LineSeries using psDash

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Ian
Newbie
Newbie
Posts: 5
Joined: Tue Jan 22, 2008 12:00 am

LineSeries using psDash

Post by Ian » Wed Apr 22, 2009 8:04 am

Hello,

Is it possible to use psDash with thick lines? With
Series: TChartSeries;
it works fine with
Series.Pen.Style := psDash;
provided
Series.Pen.Width := 1;
With width greater than 1 it comes out like a bad solid line.
I'm using 100 points.

Many thanks in advance.
Ian

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Wed Apr 22, 2009 9:10 am

Hi Ian,

What is the height of your chart? I've tested it here and, to see a continous line, you need a chart with a height smaller than 130. Here is the code I've used:

Code: Select all

uses series;

procedure TForm1.FormCreate(Sender: TObject);
var series1: TLineSeries;
begin
  Chart1.Align := alClient;
  Chart1.View3D := False;

  series1 := TLineSeries.Create(nil);
  Chart1.AddSeries(series1);
  series1.FillSampleValues(100);
  series1.Pen.Style := psDash;
  series1.Pen.Width := 4;
end;

procedure TForm1.Chart1Resize(Sender: TObject);
begin
  Chart1.Title.Text.Text := 'Chart Height: ' + IntToStr(Chart1.Height) + '    Width: ' + IntToStr(Chart1.Width);
end;
Please, take a look at this thread where this was discussed before too.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Ian
Newbie
Newbie
Posts: 5
Joined: Tue Jan 22, 2008 12:00 am

Yes but...

Post by Ian » Wed Apr 22, 2009 10:38 am

Thanks Yeray

I've just had a look at the thread you mention and I'm not surprised that the problem is that the data points are too close together so that it starts drawing after each point. If the points are closer than the length of the dashes, then there is no chance of a space. I encountered this problem years ago when I wrote my own graphics routines, but got round it with a bit of geometry (not difficult). I think my problem was a combination of the graph size and number of points - I think I can get round it.

One point to note about the randomly filled graphs is that the total length of the curve is quite big. For a smooth function, such as a sine curve, or straight line, I think the problem would be encountered earlier (in terms of the graph getting smaller).

Anyway, I think I can sort this out now, so many thanks.

Best regards, Ian

Post Reply