mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
* feat: add ESM support * build: rename UMD bundle * chore: edit supbackages description * style: disable es/no-import-meta linter rule * test: dynamic import in cjs module * docs: edit integrations page * docs: review fixes * chore: remove useless regex in webpack config * ci: test size-limit only for ESM bundle
34 lines
514 B
TypeScript
34 lines
514 B
TypeScript
import { Chart } from '..';
|
|
|
|
const chart = new Chart('test', {
|
|
type: 'bar',
|
|
data: {
|
|
labels: ['a'],
|
|
datasets: [{
|
|
data: [1],
|
|
}, {
|
|
type: 'line',
|
|
data: [{ x: 1, y: 1 }]
|
|
}]
|
|
},
|
|
options: {
|
|
animation: {
|
|
duration: 500
|
|
},
|
|
backgroundColor: 'red',
|
|
datasets: {
|
|
line: {
|
|
animation: {
|
|
duration: 600
|
|
},
|
|
backgroundColor: 'blue',
|
|
}
|
|
},
|
|
elements: {
|
|
point: {
|
|
backgroundColor: 'red'
|
|
}
|
|
}
|
|
}
|
|
});
|