RemoveAllObjects
Syntax
RemoveAllObjects(objType: TObjectType, isStatic?: boolean, window?: number): voidParameters
Description
Example
// Remove all trend lines
this.api.RemoveAllObjects(TObjectType.TREND_LINE);
// Remove all static text labels
this.api.RemoveAllObjects(TObjectType.TEXT, true);
// Clean up all drawing objects
const objectTypes = [
TObjectType.TREND_LINE,
TObjectType.RECTANGLE,
TObjectType.TRIANGLE,
TObjectType.TEXT,
];
for (const type of objectTypes) {
this.api.RemoveAllObjects(type);
}
// Remove objects and log count
const beforeCount = this.api.GetObjectCount();
this.api.RemoveAllObjects(TObjectType.RECTANGLE);
const afterCount = this.api.GetObjectCount();
console.log(`Removed ${beforeCount - afterCount} rectangle objects`);Last updated