To remove a drawing, you first need to capture its
For example, creating a drawing and recording the
// Create a drawing, storing the ID for future use (for example, in Framework.$myDrawingId)
Framework.ChartChange({
mode: "active", // or "all", or "single" plus a .chartId value
command: "create-drawing",
drawing: { … }
}, function (MsgResponse) {
if (MsgResponse.result.success) {
// Drawing added. Store the ID for later use:
Framework.$myDrawingId = MsgResponse.result.drawingId;
} else {
// Failed.
// Textual error message in MsgResponse.result.error
}
});
You can then later remove the drawing as follows:
Framework.ChartChange({
mode: "active", // or "all", or "single" plus a .chartId value
command: "remove-drawing",
drawingId: Framework.$myDrawingId
});
Note: it is almost always inefficient and undesirable to change a drawing by removing it and then re-creating it, rather than modifying the drawing.