Skip to content

VerticalAlignment

Summary

Describes vertical position related to an anchor point or a parent element.

Signature

1
public enum VerticalAlignment

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
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to use the VerticalAlignment
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class VerticalAlignmentSample : Indicator
     {
         [Parameter("Vertical Alignment", DefaultValue = VerticalAlignment.Center)]
         public VerticalAlignment VerticalAlignment { get; set; }
         protected override void Initialize()
         {
             var textBlock = new TextBlock
             {
                 Text = string.Format("Alignment: {0}", VerticalAlignment),
                 VerticalAlignment = VerticalAlignment,
                 HorizontalAlignment = HorizontalAlignment.Center
             };
             Chart.AddControl(textBlock);
         }
         public override void Calculate(int index)
         {
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 class Test():    
     def initialize(self):
         textBlock = TextBlock()
         # VerticalAlignment is a parameter of type VerticalAlignment Enum defined in indicator C# file
         textBlock.Text = f"Alignment: {api.VerticalAlignment}"
         textBlock.VerticalAlignment = api.VerticalAlignment
         textBlock.HorizontalAlignment = HorizontalAlignment.Center
         api.Chart.AddControl(textBlock)

See Also

Fields

Center

Summary

Center vertical alignment.

Signature

1
VerticalAlignment.Center;

Return Value

VerticalAlignment

Top

Summary

Top vertical alignment.

Signature

1
VerticalAlignment.Top;

Return Value

VerticalAlignment

Bottom

Summary

Bottom vertical alignment.

Signature

1
VerticalAlignment.Bottom;

Return Value

VerticalAlignment

Stretch

Summary

Stretch vertical alignment.

Signature

1
VerticalAlignment.Stretch;

Return Value

VerticalAlignment