Skip to content

Line

Summary

Represents the line shape.

Signature

1
public class Line : Shape

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to draw a line shape on your chart
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class LineShapeSample : Indicator
     {
         protected override void Initialize()
         {
             var xCenter = Chart.Width / 2;
             var yCenter = Chart.Height / 2;
             var line = new Line
             {
                 X1 = xCenter,
                 X2 = xCenter + 100,
                 Y1 = yCenter,
                 Y2 = yCenter + 100,
                 StrokeColor = Color.Red,
                 StrokeThickness = 2
             };
             Chart.AddControl(line);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

Properties

X1

Summary

Gets or sets x-axis point 1 data.

Signature

1
public double X1 {get; set;}

Return Value

double

Y1

Summary

Gets or sets the y-axis point 2 data.

Signature

1
public double Y1 {get; set;}

Return Value

double

X2

Summary

Gets or sets the x-axis point 2 data.

Signature

1
public double X2 {get; set;}

Return Value

double

Y2

Summary

Gets or sets the y-axis point 2 data.

Signature

1
public double Y2 {get; set;}

Return Value

double