svelte-chartjs

[![npm version](https://badge.fury.io/js/svelte-chartjs.svg)](https://badge.fury.io/js/svelte-chartjs) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSauravKanchan%2Fsvelte-chartjs.svg?type=shield)](https://app.fossa.com/projects/g

Usage no npm install needed!

<script type="module">
  import svelteChartjs from 'https://cdn.skypack.dev/svelte-chartjs';
</script>

README

svelte-chartjs

npm version FOSSA Status npm

Svelte wrapper for chart.js Open for PRs and contributions!

Full Documentation and demo here

Installation

npm i svelte-chartjs

Usage

<script>
  import Line from "svelte-chartjs/src/Line.svelte"
</script>
<Line data={...} />

Custom Size

In order for Chart.js to obey the custom size you need to set maintainAspectRatio to false, example:

<Bar
  data={data}
  width={100}
  height={50}
  options={{ maintainAspectRatio: false }}
/>

License

FOSSA Status