From f8992a61681c369e8ca0074704f10f0b6d5c1a06 Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Sun, 28 Nov 2021 13:01:00 -0500 Subject: [PATCH] Doughnut chart options have an offset property (#9916) --- types/index.esm.d.ts | 10 ++++++++++ types/tests/controllers/doughnut_offset.ts | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 types/tests/controllers/doughnut_offset.ts diff --git a/types/index.esm.d.ts b/types/index.esm.d.ts index d8759fa6b..df69eb02e 100644 --- a/types/index.esm.d.ts +++ b/types/index.esm.d.ts @@ -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>; + /** + * 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%' diff --git a/types/tests/controllers/doughnut_offset.ts b/types/tests/controllers/doughnut_offset.ts new file mode 100644 index 000000000..58f7546bd --- /dev/null +++ b/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, + } +}); -- 2.47.2