Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bherbruck/svelte-echarts

Apache ECharts wrapper for Svelte
https://github.com/bherbruck/svelte-echarts

svelte

Last synced: about 1 month ago
JSON representation

Apache ECharts wrapper for Svelte

Awesome Lists containing this project

README

        

# svelte-echarts

A simple [Apache ECharts](https://echarts.apache.org/) component for [Svelte](https://svelte.dev/)! Check out this [demo](https://bherbruck.github.io/svelte-echarts/).

## 💿 Installation

```bash
npm i -D svelte-echarts echarts
```

## ⌨️ Usage [demo](https://bherbruck.github.io/svelte-echarts/)

```html

import { Chart } from 'svelte-echarts'

import { init, use } from 'echarts/core'
import { BarChart } from 'echarts/charts'
import { GridComponent, TitleComponent } from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'

// now with tree-shaking
use([BarChart, GridComponent, CanvasRenderer, TitleComponent])

let options = {
title: {
text: 'ECharts Example',
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
},
yAxis: {
type: 'value',
},
series: [
{
type: 'bar',
data: [120, 200, 150, 80, 70, 110, 130],
},
],
}



.app {
width: 100vw;
height: 100vh;
}

```