You can use ChartChange() to add an event marker to a chart. Event markers are created against specific date/times, and drawn at the bottom of the chart. They are automatically stacked if there is more than one marker for each bar.
(Event markers are intended for things such as calendar events, which apply to a bar as a whole. To draw a marker against both a date/time and also a specific price, use a barMarker drawing.)
The
// Draw a marker against a date
Framework.ChartChange({
mode: "active", // or "all", or "single" plus a .chartId value
command: "create-event-marker",
marker: {
date: 1778072400000,
icon: "f00d", // Font Awesome cross glyph (0xF00D)
color: "red"
}
});
The optional callback from
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.
// ID of new marker is in MsgResponse.result.markerId
} else {
// Failed.
// Textual error message in MsgResponse.result.error
}
});