From: Evert Timberg Date: Sun, 28 Nov 2021 18:01:00 +0000 (-0500) Subject: Doughnut chart options have an offset property (#9916) X-Git-Tag: v3.6.1~6 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=f8992a61681c369e8ca0074704f10f0b6d5c1a06;p=thirdparty%2FChart.js.git Doughnut chart options have an offset property (#9916) --- 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, + } +});