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

Method _updateRadius

src/controllers/controller.polarArea.js:147–159  ·  view source on GitHub ↗

* @private

()

Source from the content-addressed store, hash-verified

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

Callers 1

updateMethod · 0.95

Calls 1

Tested by

no test coverage detected