Skip to content

ChartDraggables.Add

method · ChartDraggables · cAlgo.API Since 5.2

DesktopCLICloud

Adds a draggable to chart area.

Environment behaviour

CLI — not supported. Add returns a draggable that is never displayed; Remove sends nothing to any chart.

Cloud — not supported. Add returns a draggable that is never displayed; Remove sends nothing to any chart.

Definition

ChartDraggable Add()
chartDraggables.Add() -> ChartDraggable

Returns ChartDraggable — Draggable

Examples

var draggable = Chart.Draggables.Add();
draggable.Child = new TextBlock { Text = "Drag me", BackgroundColor = Color.Black };
Print("Draggables on the chart: {0}", Chart.Draggables.Count);
draggable = api.Chart.Draggables.Add()
textBlock = TextBlock()
textBlock.Text = "Drag me"
draggable.Child = textBlock
api.Print(f"Draggables on the chart: {api.Chart.Draggables.Count}")