@simon_he/s-charts
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

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, 是否自动调整宽高
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],
    },
  ],
})

Readme

Keywords

Package Sidebar

Install

npm i @simon_he/s-charts

Weekly Downloads

0

Version

0.0.5

License

MIT

Unpacked Size

2.1 MB

Total Files

5

Last publish

Collaborators

  • simon_he