Svelte wrapper for chart.js Open for PRs and contributions!
Install this library with peer dependencies:
bun add @sveltejs-labs/chart.js chart.js
# or
pnpm add @sveltejs-labs/chart.js chart.js
# or
yarn add @sveltejs-labs/chart.js chart.js
# or
npm i @sveltejs-labs/chart.js chart.js
<script>
import { Line } from '@sveltejs-labs/chart.js'
</script>
<Line data={...} />
In order for Chart.js to obey the custom size you need to set maintainAspectRatio
to false, example:
<Line {data} width={100} height={50} options={{ maintainAspectRatio: false }} />
Read LICENSE.md