@jhit/echarts-web-component
v0.2.9
Published
ECharts Web Component
Readme
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: 350px; display: inline-block; width: auto; max-width: 100%; "
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 Rrefreshjhit 2025-04-25
