loading...

Svelte XKCD chart

shriji profile image Shriji ・1 min read

The charts library already have vue and react wrappers so it lacked the svelte version of the library.

Introducing chart.xkcd-svelte

All chart examples can be found here

General usage for svelte and check out the REPL

<script>

    import Chart from 'chart.xkcd-svelte';
    import chartXkcd from 'chart.xkcd';

let options = {
        title: 'What people think', // optional
        data: {
            labels: ['work', 'sleep', 'social'],
            datasets: [{
                data: [30, 10, 60],
            }],
        },
        options: { // optional
            innerRadius: 0,
            legendPosition: chartXkcd.config.positionType.upLeft,
        },
    }
let type = "bar";
</script>
<Chart type={type} options={options} />


Thanks to awesome people at svelte's discord I was able to do this ❤️❤️

Posted on by:

shriji profile

Shriji

@shriji

Co-Founder @anoram. High Performance JavaScript Apps. I created https://vadivelu.anoram.com/ and https://biriyani.anoram.com/ API.

Discussion

markdown guide