@jhit/echarts-web-component

0.2.5 • Public • Published

jhit-echarts

jhit-echarts 是一个基于 ECharts 的 Web Component,并内置图表导出功能。

安装

npm i @jhit/echarts-web-component

使用

以HTML为例

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Echarts Web Component</title>
  <script src="https://unpkg.com/@jhit/echarts-web-component"></script>
</head>
<body>
  <jhit-echarts
    downloadable
    style="height: 300px; width: 500px;"
    option='{
      "title": {"text": "示例图表"},
      "xAxis": {"data": ["A", "B", "C"]},
      "yAxis": {},
      "series": [{"type": "bar", "data": [10, 20, 30]}]
    }'
  />
</body>
</html>

参数

参数名 类型 说明
option string ECharts 图表配置项
style string ECharts 容器样式
downloadable boolean 是否显示导出按钮

开发

npm run build
npm run dev     # F5 Rrefresh

jhit 2025-04-25

Package Sidebar

Install

npm i @jhit/echarts-web-component

Weekly Downloads

1

Version

0.2.5

License

none

Unpacked Size

2.62 MB

Total Files

4

Last publish

Collaborators

  • axolo
  • kira1129
  • xiaoxin9898
  • zhengyanchao
  • lzq9999999
  • 11yqy
  • yangyanan
  • jiangxiaomin
  • weizhangjing