Lazarus

Programming => LCL => Topic started by: swidi_ on February 16, 2014, 12:30:46 pm

Title: TChart vertical lines
Post by: swidi_ on February 16, 2014, 12:30:46 pm
Hello,

I'm looking for solution to place vertical lines in all points of the data series. The problem is, the lines must be visible even the point are under/over the visible area.

Now im using:

//on draw point
procedure TForm2.SeriesStateDrawPointer(ASender: TChartSeries;
  ACanvas: TCanvas; AIndex: Integer; ACenter: TPoint);
begin
//start
  ACanvas.Line(ACenter.x, ACanvas.Height, ACenter.x, 0);
end;     

Just the lines are not draw when the point isn't draw.

Have You any solution for me ?

Title: Re: TChart vertical lines
Post by: wp on February 16, 2014, 05:50:22 pm
You want to draw a line from the point down to the axis? Why not use a TBarSeries with BarWidthPercent = 1?
In the attached screenshot I used two series, a BarSeries and a LineSeries, linked to the same ChartSource. The BarSeries has BarWidthPercent=1, and the LineSeries has the interconnecting lines turned off and the symbols turned on. The y extent of the chart is restricted to cut off some data points.
Title: Re: TChart vertical lines
Post by: swidi_ on February 16, 2014, 11:28:23 pm
Thanks for Your advice,

Vertical lines marks the events. When the vertical line crossing with others data series then we know about event in this point of data.
Examle: Temperature chart crossing with vertical line of events 'start fan'. We know when temperature reachd this value then fan was started.