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

Method getMaxOverflow

src/controllers/controller.scatter.js:156–178  ·  view source on GitHub ↗

* @protected

()

Source from the content-addressed store, hash-verified

154 * @protected
155 */
156 getMaxOverflow() {
157 const meta = this._cachedMeta;
158 const data = meta.data || [];
159
160 if (!this.options.showLine) {
161 let max = 0;
162 for (let i = data.length - 1; i >= 0; --i) {
163 max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);
164 }
165 return max > 0 && max;
166 }
167
168 const dataset = meta.dataset;
169 const border = dataset.options && dataset.options.borderWidth || 0;
170
171 if (!data.length) {
172 return border;
173 }
174
175 const firstPoint = data[0].size(this.resolveDataElementOptions(0));
176 const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));
177 return Math.max(border, firstPoint, lastPoint) / 2;
178 }
179}

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80

Tested by

no test coverage detected