MCPcopy Create free account
hub / github.com/chartjs/Chart.js / constructor

Method constructor

src/plugins/plugin.legend.js:46–80  ·  view source on GitHub ↗

* @param {{ ctx: any; options: any; chart: any; }} config

(config)

Source from the content-addressed store, hash-verified

44 * @param {{ ctx: any; options: any; chart: any; }} config
45 */
46 constructor(config) {
47 super();
48
49 this._added = false;
50
51 // Contains hit boxes for each dataset (in dataset order)
52 this.legendHitBoxes = [];
53
54 /**
55 * @private
56 */
57 this._hoveredItem = null;
58
59 // Are we in doughnut mode which has a different data type
60 this.doughnutMode = false;
61
62 this.chart = config.chart;
63 this.options = config.options;
64 this.ctx = config.ctx;
65 this.legendItems = undefined;
66 this.columnSizes = undefined;
67 this.lineWidths = undefined;
68 this.maxHeight = undefined;
69 this.maxWidth = undefined;
70 this.top = undefined;
71 this.bottom = undefined;
72 this.left = undefined;
73 this.right = undefined;
74 this.height = undefined;
75 this.width = undefined;
76 this._margins = undefined;
77 this.position = undefined;
78 this.weight = undefined;
79 this.fullSize = undefined;
80 }
81
82 update(maxWidth, maxHeight, margins) {
83 this.maxWidth = maxWidth;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected