From: Jukka Kurkela Date: Sun, 4 Jul 2021 11:26:22 +0000 (+0300) Subject: Add type tests for float bar / object data arrays (#9348) X-Git-Tag: v3.4.1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=124581a679fa9e048defedc245c7f41ac90c448a;p=thirdparty%2FChart.js.git Add type tests for float bar / object data arrays (#9348) --- diff --git a/types/tests/data_types.ts b/types/tests/data_types.ts new file mode 100644 index 000000000..1740d8e66 --- /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' }, + }, +});