Skip to content

ChartObject.ZIndex

property · ChartObject · cAlgo.API

DesktopCLICloud

Gets or sets the location of a chart object on the Z-axis in respect to the other chart objects.

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

int ZIndex {get; set;}
chartObject.ZIndex: int

Returns int

Examples

var rectangle = Chart.DrawRectangle("zone", Bars.OpenTimes.Last(20), Bars.LowPrices.Last(20), Bars.OpenTimes.LastValue, Bars.HighPrices.LastValue, Color.FromArgb(80, Color.Blue));
var line = Chart.DrawHorizontalLine("support", Bars.LowPrices.LastValue, Color.Green);
line.ZIndex = rectangle.ZIndex + 1;
Print("Line Z-index: {0} | Rectangle Z-index: {1}", line.ZIndex, rectangle.ZIndex);
rectangle = api.Chart.DrawRectangle("zone", api.Bars.OpenTimes.Last(20), api.Bars.LowPrices.Last(20), api.Bars.OpenTimes.LastValue, api.Bars.HighPrices.LastValue, Color.FromArgb(80, Color.Blue))
line = api.Chart.DrawHorizontalLine("support", api.Bars.LowPrices.LastValue, Color.Green)
line.ZIndex = rectangle.ZIndex + 1
api.Print(f"Line Z-index: {line.ZIndex} | Rectangle Z-index: {rectangle.ZIndex}")