Doughnut chart options have an offset property (#9916)

This commit is contained in:
Evert Timberg 2021-11-28 13:01:00 -05:00 committed by GitHub
parent 7cbc47becc
commit f8992a6168
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

10
types/index.esm.d.ts vendored
View File

@ -244,6 +244,11 @@ export interface DoughnutControllerDatasetOptions
*/
circumference: number;
/**
* Arc offset (in pixels).
*/
offset: number;
/**
* Starting angle to draw this dataset from.
* @default 0
@ -292,6 +297,11 @@ export interface DoughnutControllerChartOptions {
*/
cutout: Scriptable<number | string, ScriptableContext<'doughnut'>>;
/**
* Arc offset (in pixels).
*/
offset: number;
/**
* The outer radius of the chart. String ending with '%' means percentage of maximum radius, number means pixels.
* @default '100%'

View File

@ -0,0 +1,15 @@
import { Chart, ChartMeta, Element } from '../../index.esm';
const chart = new Chart('id', {
type: 'doughnut',
data: {
labels: [],
datasets: [{
data: [],
offset: 40,
}]
},
options: {
offset: 20,
}
});