Skip to content

StretchDirection

Summary

Describes how scaling applies to content and restricts scaling to named axis types.

Signature

1
public enum StretchDirection

Namespace

cAlgo.API

Fields

Name Description
UpOnly The content scales upward only when it is smaller than the parent. If the content is larger, no scaling downward is performed.
DownOnly The content scales downward only when it is larger than the parent. If the content is smaller, no scaling upward is performed.
Both The content stretches to fit the parent according to the Stretch mode.

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 use the StretchDirection
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class StretchDirectionSample : Indicator
     {
         [Parameter("Stretch Direction", DefaultValue = StretchDirection.UpOnly)]
         public StretchDirection StretchDirection { get; set; }
         protected override void Initialize()
         {
             var image = new Image
             {
                 Source = Properties.Resources.ctrader_logo,
                 Width = 200,
                 Height = 200,
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
                 StretchDirection = StretchDirection
             };
             Chart.AddControl(image);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

Last update: July 1, 2022

Comments