]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Types: fix bubble chart options (#8625)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Sat, 13 Mar 2021 13:04:59 +0000 (15:04 +0200)
committerGitHub <noreply@github.com>
Sat, 13 Mar 2021 13:04:59 +0000 (08:04 -0500)
test/types/simple.ts [deleted file]
types/index.esm.d.ts
types/tests/controllers/bubble_chart_options.ts [new file with mode: 0644]

diff --git a/test/types/simple.ts b/test/types/simple.ts
deleted file mode 100644 (file)
index 214dd07..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-import {Chart, IBarControllerConfiguration} from '../..';
-
-const bar = new Chart(document.createElement('canvas'), {
-    type: 'bar',
-    data: {
-        labels: ['A', 'B'],
-        datasets: [
-            {
-                data: [1,2],
-            }
-        ]
-    }
-});
-
-const barTyped = new Chart<number, string, IBarControllerConfiguration<number, string>>(document.createElement('canvas'), {
-    type: 'bar',
-    data: {
-        labels: ['A', 'B'],
-        datasets: [
-            {
-                data: [1,2],
-            }
-        ]
-    }
-});
\ No newline at end of file
index f72cd8ae3f96757a8be171165f4293a4b963f71e..c1947105508dfe0812d2cdcf94a6a8a464fda996 100644 (file)
@@ -3184,7 +3184,7 @@ export interface ChartTypeRegistry {
     scales: keyof CartesianScaleTypeRegistry;
   };
   bubble: {
-    chartOptions: EmptyObject;
+    chartOptions: unknown;
     datasetOptions: BubbleControllerDatasetOptions;
     defaultDataPoint: BubbleDataPoint;
     parsedDataType: BubbleParsedData;
@@ -3268,7 +3268,7 @@ export interface ChartData<
   TData = DefaultDataPoint<TType>,
   TLabel = unknown
 > {
-  labels: TLabel[];
+  labels?: TLabel[];
   datasets: ChartDataset<TType, TData>[];
 }
 
diff --git a/types/tests/controllers/bubble_chart_options.ts b/types/tests/controllers/bubble_chart_options.ts
new file mode 100644 (file)
index 0000000..e036037
--- /dev/null
@@ -0,0 +1,22 @@
+import { Chart, ChartOptions } from '../../index.esm';
+
+const chart = new Chart('test', {
+  type: 'bubble',
+  data: {
+    datasets: []
+  },
+  options: {
+    scales: {
+      x: {
+        min: 0,
+        max: 30,
+        ticks: {}
+      },
+      y: {
+        min: 0,
+        max: 30,
+        ticks: {},
+      },
+    }
+  }
+});