Svelte Apache Echarts
How to use apache echarts with svelte
<script>
import * as echarts from 'echarts';
import { onMount } from 'svelte';
let data = {
xAxis: { type: 'category', data: ['Mon', 'Tue'] },
yAxis: { type: 'value'},
series: [ {data: [120, 200], type: 'bar'} ]
}
function chart(node){
const chart = echarts.init(node)
chart.setOption(data)
}
</script>
<div style="width: 100%; height: 300px" use:chart/>