Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/simon-he95/scharts
- Owner: Simon-He95
- Created: 2022-07-26T01:09:48.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T02:45:37.000Z (11 months ago)
- Last Synced: 2024-03-15T09:22:30.515Z (8 months ago)
- Topics: echarts
- Language: TypeScript
- Homepage:
- Size: 84 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
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],
},
],
})
```