From 33b9c8574eab337d09e8a84fef14b85a7d6a5fd0 Mon Sep 17 00:00:00 2001 From: Deepak kudi Date: Thu, 4 Jun 2026 10:02:08 +0530 Subject: [PATCH] fix(types): allow skipNull on bar datasets --- src/types/index.d.ts | 5 +++++ test/types/controllers/bar_skip_null.ts | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 test/types/controllers/bar_skip_null.ts diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 32831adc88c..a2c64b66bf4 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -107,6 +107,11 @@ export interface BarControllerDatasetOptions */ yAxisID: string; + /** + * Should null or undefined values be omitted from drawing + */ + skipNull?: boolean; + /** * Percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other. * @default 0.9 diff --git a/test/types/controllers/bar_skip_null.ts b/test/types/controllers/bar_skip_null.ts new file mode 100644 index 00000000000..a294151e268 --- /dev/null +++ b/test/types/controllers/bar_skip_null.ts @@ -0,0 +1,12 @@ +import { Chart } from '../../../src/types.js'; + +const chart = new Chart('id', { + type: 'bar', + data: { + labels: ['1', '2', '3'], + datasets: [{ + data: [1, 2, 3], + skipNull: true + }] + }, +});