You can use ChartChange() to add a drawing to a chart. The
Framework.ChartChange({
mode: "active", // or "all", or "single" plus a .chartId value
command: "create-drawing",
drawing: {
type: "lineSegment",
points: [
{date: 1778025600000, value: 1.170},
{date: 1778054400000, value: 1.175}
],
style: {line: {color: "red"}}
}
});
The optional callback from
Framework.ChartChange({
mode: "active", // or "all", or "single" plus a .chartId value
command: "create-drawing",
drawing: { … }
}, function (MsgResponse) {
if (MsgResponse.result.success) {
// Drawing added.
// ID of new drawing is in MsgResponse.result.drawingId
} else {
// Failed.
// Textual error message in MsgResponse.result.error
}
});