Skip to content

Commit

Permalink
Add type tests for float bar / object data arrays (#9348)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Jul 4, 2021
1 parent bb2bddc commit 124581a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 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' },
},
});

0 comments on commit 124581a

Please sign in to comment.