From 084f342b5ba17dc4ccfbe9c3e19ae32e0f471ba1 Mon Sep 17 00:00:00 2001 From: kurkle Date: Sun, 4 Jul 2021 11:36:57 +0300 Subject: [PATCH] Add type tests for float bar / object data arrays --- types/tests/data_types.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 types/tests/data_types.ts diff --git a/types/tests/data_types.ts b/types/tests/data_types.ts new file mode 100644 index 00000000000..1740d8e6690 --- /dev/null +++ b/types/tests/data_types.ts @@ -0,0 +1,20 @@ +import { Chart } from '../index.esm'; + +const chart = new Chart('chart', { + type: 'bar', + data: { + labels: ['1', '2', '3'], + datasets: [{ data: [[1, 2], [1, 2], [1, 2]] }], + } +}); + +const chart2 = new Chart('chart2', { + type: 'bar', + data: { + datasets: [{ + data: [{ id: 'Sales', nested: { value: 1500 } }, { id: 'Purchases', nested: { value: 500 } }], + }], + }, + options: { parsing: { xAxisKey: 'id', yAxisKey: 'nested.value' }, + }, +});