TDrawLineTool
 
 
 

All Units  All Classes  Properties, Methods and Events  

TDrawLineTool
Hierarchy     Properties     Methods     Events     

Unit
TeeTools

Description
Permits the ability to draw Lines on the Chart via mousedrags.

The Draw Line tool allows the user to draw lines at run-time using the mouse.

The Line pen used to draw the lines is customizable.

All drawn lines coordinates are stored in the Lines
collection property.

Drawn lines can be selected, dragged and deleted.

The coordinates of each Line can be converted into axes or screen scales.

Lines can be added at design-time using the Object Inspector, adding items to Lines collection and specifying the start and end point coordinates for each line.

If you want to add lines at run-time, you can use the following code:

Create a new application, add a TChart, one Series and one DrawLine tool.

var Middle : Double;
Series1.FillSampleValues( 100 );
With Series1.YValues do Middle:=(MaxValue+MinValue)/2;
TDrawLine.CreateXY(ChartTool1.Lines,0,Middle-100,100,Middle+100);

If you wish to use your own "line" class, you can do this:

type
TMyLine=class(TDrawLine)
... your custom properties, methods, etc....
end;

TMyLine.CreateXY(ChartTool1.Lines,0,Middle-100,100,Middle+100);




Send us Help Feedback. Copyright 1995-2013 © by Steema Software. All Rights Reserved.