I'm trying to create a custom scale using ChartJs version 3.9.1, where it says to create a custom scale you just need to create a class that extends Chart.Scale from 'chartjs'.
After creating this class they tell you need to set the id property in order to access this id in chart options as
scales:{y: {type: 'MyScale'}}
Current behavior
The problem is that the interface of Chart.Scale says that its Id is readonly, so I cant se't it.
Expected behavior
I'm trying to create a custom scale using ChartJs version 3.9.1, where it says to create a custom scale you just need to create a class that extends Chart.Scale from 'chartjs'.
After creating this class they tell you need to set the id property in order to access this id in chart options as
scales:{y: {type: 'MyScale'}}
Current behavior
The problem is that the interface of Chart.Scale says that its Id is readonly, so I cant se't it.
That's my code so far:
I've tried to set the id doing this.id = 'test' but it keeps saying I can't set it because its readonly.
Reproducible sample
https://www.typescriptlang.org/play?#
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
No response
chart.js version
3.9.1
Browser name and version
No response
Link to your project
No response