2.0.0 • Published 4 months ago
@sveltejs-labs/chart.js v2.0.0
@sveltejs-labs/chart.js
Svelte wrapper for chart.js Open for PRs and contributions!
Install
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
Usage
<script>
import { Line } from '@sveltejs-labs/chart.js'
</script>
<Line data={...} />
Custom Size
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 }} />
License
Read LICENSE.md