3.9.12Removing an event marker

To remove an event marker, you first need to capture its markerId in the optional callback from ChartChange() when using create-event-marker. You can then use remove-event-marker, passing in the markerId.

For example, creating a marker and recording the markerId:

// Create a marker, storing the ID for future use (for example, in Framework.$myMarkerId)

Framework.ChartChange({

mode: "active", // or "all", or "single" plus a .chartId value

command: "create-event-marker",

marker: { … }

}, function (MsgResponse) {

if (MsgResponse.result.success) {

// Event marker added. Store the ID for later use:

Framework.$myMarkerId = MsgResponse.result.markerId;

} else {

// Failed.

// Textual error message in MsgResponse.result.error

}

});

You can then later remove the marker as follows:

Framework.ChartChange({

mode: "active", // or "all", or "single" plus a .chartId value

command: "remove-event-marker",

markerId: Framework.$myMarkerId

});