Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/simon-he95/scharts

sCharts is a easy echarts toy
https://github.com/simon-he95/scharts

echarts

Last synced: 10 days ago
JSON representation

sCharts is a easy echarts toy

Awesome Lists containing this project

README

        


s-charts


NPM version


Docs


English | 简体中文

## sCharts
- 简单化echarts使用
- 可以让你的代码更加简洁,更加美观
- 不需要在onMounted中执行,可以在任意时刻使用
- 自动监听resize事件,自动更新canvas的大小
- 参数:
- container: string | HTMLElement, 父容器
- options: SChartsOption, echarts配置options,扩展了w: 初始化宽度, h: 初始化高度, theme: echarts主题, 所有的事件行为以on开头都会被调用
- autoResize: boolean, 是否自动调整宽高
```javascript
const charts = sCharts('#main', {
w: 500,
h: 300,
theme: 'dark',
xAxis: {
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
},
yAxis: {},
series: [
{
type: 'bar',
data: [23, 24, 18, 25, 27, 28, 25],
},
],
})
```