3.9.14Adding a bar highlight to a chart

You can use ChartChange() to add a bar highlight to a chart. A highlight changes the colour of the candle which spans/contains a specified date.

The create-bar-highlight command must contain a highlight:{}definition which describes the candle to change, specifying the date of the candle and the color to use. For example:

// Change the colour of the candle which contains/spans the specified date

Framework.ChartChange({

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

command: "create-bar-highlight",

highlight: {

date: 1778072400000,

color: "red"

}

});

Note: unlike drawings and event markers, the optional callback from ChartChange() does not provide an ID for a highlight which has just been created. Instead, highlights are simply removed by date.