Skip to content

Conversation

anshukushwaha07
Copy link
Contributor

Closes #12026

The drawingArea property exists in the RadialLinearScale implementation (scale.radialLinear.js) and is used for calculating the radius of radar/polar charts.

However, it was missing from the TypeScript definitions, which caused errors like:

const scale = chart.scales.r;
console.log(scale.drawingArea); 
//  TS error: Property 'drawingArea' does not exist

Changes

  • Added readonly drawingArea: number to RadialLinearScale in types/index.d.ts.
import { Chart, RadialLinearScale } from "chart.js";

const chart = new Chart(document.createElement("canvas"), {
  type: "radar",
  data: { labels: ["A"], datasets: [{ data: [10] }] }
});

const scale = chart.scales.r as RadialLinearScale;
console.log(scale.drawingArea); //  typed as number

@etimberg etimberg added this to the Version 4.5.1 milestone Sep 18, 2025
@etimberg etimberg added the type: types Typescript type changes label Sep 18, 2025
@LeeLenaleee LeeLenaleee merged commit e275269 into chartjs:master Sep 19, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: types Typescript type changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

drawingArea should be in type RadialLinearScale?

3 participants