MCPcopy
hub / github.com/chartjs/Chart.js / acquireContext

Method acquireContext

src/platform/platform.basic.js:14–19  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

12 */
13export default class BasicPlatform extends BasePlatform {
14 acquireContext(item) {
15 // To prevent canvas fingerprinting, some add-ons undefine the getContext
16 // method, for example: https://github.com/kkapsner/CanvasBlocker
17 // https://github.com/chartjs/Chart.js/issues/2807
18 return item && item.getContext && item.getContext('2d') || null;
19 }
20 updateConfig(config) {
21 config.options.animation = false;
22 }

Callers

nothing calls this directly

Calls 1

getContextMethod · 0.45

Tested by

no test coverage detected