Skip to content

ChartTemplates.Remove

method · ChartTemplates · cAlgo.API Since 5.6

DesktopCLICloud

Removes an existing chart template.

Environment behaviour

CLI — works differently. No templates are listed; Create works for this run only and is not saved; Remove returns false; DefaultTemplate throws NullReferenceException.

Cloud — not supported. Empty: Get returns null, Contains and Remove return false, Create and Duplicate throw, DefaultTemplate throws NullReferenceException.

Definition

bool Remove(ChartTemplate chartTemplate)
api.ChartTemplates.Remove(chartTemplate: ChartTemplate) -> bool

Parameters

Name C# type Python type Description
chartTemplate ChartTemplate ChartTemplate ChartTemplate that will removed

Returns bool — True if succeeded otherwise False.

Examples

var template = ChartTemplates.Get("Old Template");
if (template != null)
    Print("Template removed: {0}", ChartTemplates.Remove(template));
template = api.ChartTemplates.Get("Old Template")
if template is not None:
    api.Print(f"Template removed: {api.ChartTemplates.Remove(template)}")