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

Method _updateRadius

src/controllers/controller.polarArea.js:145–157  ·  view source on GitHub ↗

* @private

()

Source from the content-addressed store, hash-verified

143 * @private
144 */
145 _updateRadius() {
146 const chart = this.chart;
147 const chartArea = chart.chartArea;
148 const opts = chart.options;
149 const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);
150
151 const outerRadius = Math.max(minSize / 2, 0);
152 const innerRadius = Math.max(opts.cutoutPercentage ? (outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);
153 const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();
154
155 this.outerRadius = outerRadius - (radiusLength * this.index);
156 this.innerRadius = this.outerRadius - radiusLength;
157 }
158
159 updateElements(arcs, start, count, mode) {
160 const reset = mode === 'reset';

Callers 1

updateMethod · 0.95

Calls 1

Tested by

no test coverage detected