Skip to content

Commit

Permalink
Doughnut chart options have an offset property (#9916)
Browse files Browse the repository at this point in the history
  • Loading branch information
etimberg committed Nov 28, 2021
1 parent 7cbc47b commit f8992a6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions types/index.esm.d.ts
Expand Up @@ -244,6 +244,11 @@ export interface DoughnutControllerDatasetOptions
*/
circumference: number;

/**
* Arc offset (in pixels).
*/
offset: number;

/**
* Starting angle to draw this dataset from.
* @default 0
Expand Down Expand Up @@ -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%'
Expand Down
15 changes: 15 additions & 0 deletions types/tests/controllers/doughnut_offset.ts
@@ -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,
}
});

0 comments on commit f8992a6

Please sign in to comment.