Keeps a drawing controller's document per instrument. Build it once the controller exists; it follows the chart's data context from then on.

const scoped = new InstrumentDrawings(chart, draw, {
store: webStorageDrawingStore(localStorage, 'my-app:drawings:'),
});
chart.setDataContext({ symbol: 'INFY', exchange: 'NSE', interval: '5m' });

Constructors

Accessors

Methods

  • The key of the instrument whose drawings are on the chart, or null before the chart has named one.

    Returns null | string

  • Write the current instrument's document now, and any the store refused before. False while one is still refused.

    Returns boolean

  • Replace one instrument's drawings. On the current instrument that is the controller's fromJSON, which clears its undo history; on any other, the stored document, shown when the chart next moves there. For a layout that brings the drawings of an instrument the chart is about to show.

    Parameters

    Returns void

  • Move to another instrument now, without waiting for the chart's data context: for a host that does not publish one, or that switches its drawings ahead of its data. A later context naming the same instrument changes nothing. Null, or an instrument with no key, changes nothing.

    Parameters

    Returns void