Skip to content

ChartText.HorizontalAlignment

property · ChartText · cAlgo.API

DesktopCLICloud

Gets or sets the horizontal alignment of the text regarding the anchor point.

Environment behaviour

CLI — works differently. Created and kept with all its properties, but never drawn: the CLI displays no chart.

Cloud — works differently. Created and kept with all its properties, but never drawn: the cloud displays no chart.

Definition

HorizontalAlignment HorizontalAlignment {get; set;}
chartText.HorizontalAlignment: HorizontalAlignment

Returns HorizontalAlignment

Examples

var text = Chart.DrawText("label", "High", Bars.OpenTimes.LastValue, Bars.HighPrices.LastValue, Color.White);
text.HorizontalAlignment = HorizontalAlignment.Center;
Print("Text horizontal alignment: {0}", text.HorizontalAlignment);
text = api.Chart.DrawText("label", "High", api.Bars.OpenTimes.LastValue, api.Bars.HighPrices.LastValue, Color.White)
text.HorizontalAlignment = HorizontalAlignment.Center
api.Print(f"Text horizontal alignment: {text.HorizontalAlignment}")