We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The offset should be defined as an number of number array.
export interface DoughnutControllerDatasetOptions{ /** * Arc offset (in pixels). */ - offset: number; + offset: number | number[]; } export interface DoughnutControllerChartOptions { /** * Arc offset (in pixels). */ - offset: number; + offset: number | number[]; }
According to the test https://github.com/chartjs/Chart.js/blob/master/test/fixtures/controller.doughnut/doughnut-spacing-and-offset.js the offset can be an array of numbers, but the typing in DoughnutControllerDatasetOptions and DoughnutControllerChartOptions describe it as a number
DoughnutControllerDatasetOptions
DoughnutControllerChartOptions
https://www.typescriptlang.org/play?ssl=32&ssc=1&pln=1&pc=1#code/JYWwDg9gTgLgBAbzgYQBYENZwL5wGZQQhwDkAxhrAHQBWAziQNwCwAUGwG6ZxkwAecALxwAJhDIBXEAFMAdjCoBzaTACiAG2kz5AIQCeASREAKAEQg9aTDFMBKOOjpwAEgBUAsgBlk6WVzoaWnIwLKxcUHAWVljCstIA7iiUMMa8fAA0iGxwOXAwemDSAFykYhKKqLISMCTp2bki6DDoJQj1uaJNjip0JQDabawdHY3N-QCMAAyZAEzTcAAs8wCsKwC6dUPDOeroAEbS6iUkACJddCpw47Xtw3voZADWioQSsiLIEOrQ-bfbJFBpCIblttjkSNBfMoQWDciQ9IdvvEYbDSC9pHIUbCSHt1BJpCQ-rk1kTsBsibsDupenA+kTwQYYForljhiRGcyZqyOuymcQAMzcuEc4gLIUMvlwZaE0HEzYdbDy3IQMAwYAQWQ0wbbOhgB7AWSKEqrJUdCB4PAXGD9FbzO2ZSbk2XYeou1jYWyhIA
This typescipt example is the code from https://github.com/chartjs/Chart.js/blob/master/test/fixtures/controller.doughnut/doughnut-spacing-and-offset.js
import { Chart } from 'chart.js'; var ctx = document.getElementById("myChart") as HTMLCanvasElement; var myChart = new Chart(ctx, { type: 'doughnut', data: { datasets: [{ data: [10, 20, 40, 50, 5], label: 'Dataset 1', backgroundColor: [ 'red', 'orange', 'yellow', 'green', 'blue' ] }], labels: [ 'Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5' ], }, options: { spacing: 50, offset: [0, 50, 0, 0, 0], /* typings error */ } } });
No response
v3.7.0 and v4.1.2
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Expected behavior
The offset should be defined as an number of number array.
Current behavior
According to the test https://github.com/chartjs/Chart.js/blob/master/test/fixtures/controller.doughnut/doughnut-spacing-and-offset.js the offset can be an array of numbers, but the typing in
DoughnutControllerDatasetOptions
andDoughnutControllerChartOptions
describe it as a numberReproducible sample
https://www.typescriptlang.org/play?ssl=32&ssc=1&pln=1&pc=1#code/JYWwDg9gTgLgBAbzgYQBYENZwL5wGZQQhwDkAxhrAHQBWAziQNwCwAUGwG6ZxkwAecALxwAJhDIBXEAFMAdjCoBzaTACiAG2kz5AIQCeASREAKAEQg9aTDFMBKOOjpwAEgBUAsgBlk6WVzoaWnIwLKxcUHAWVljCstIA7iiUMMa8fAA0iGxwOXAwemDSAFykYhKKqLISMCTp2bki6DDoJQj1uaJNjip0JQDabawdHY3N-QCMAAyZAEzTcAAs8wCsKwC6dUPDOeroAEbS6iUkACJddCpw47Xtw3voZADWioQSsiLIEOrQ-bfbJFBpCIblttjkSNBfMoQWDciQ9IdvvEYbDSC9pHIUbCSHt1BJpCQ-rk1kTsBsibsDupenA+kTwQYYForljhiRGcyZqyOuymcQAMzcuEc4gLIUMvlwZaE0HEzYdbDy3IQMAwYAQWQ0wbbOhgB7AWSKEqrJUdCB4PAXGD9FbzO2ZSbk2XYeou1jYWyhIA
Optional extra steps/info to reproduce
This typescipt example is the code from https://github.com/chartjs/Chart.js/blob/master/test/fixtures/controller.doughnut/doughnut-spacing-and-offset.js
Possible solution
No response
Context
No response
chart.js version
v3.7.0 and v4.1.2
Browser name and version
No response
Link to your project
No response
The text was updated successfully, but these errors were encountered: