1 Star 0 Fork 0

twp0217 / react-echarts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

react-echarts

Apache ECharts component for React(基于 React 的 Apache ECharts 组件)

安装

npm install echarts @twp0217/react-echarts --save

使用

import React from 'react';
import ECharts, { EChartsOption } from '@twp0217/react-echarts';

export default () => {
  const option: EChartsOption = {
    title: {
      text: 'ECharts 入门示例',
    },
    tooltip: {},
    legend: {
      data: ['销量'],
    },
    xAxis: {
      data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'],
    },
    yAxis: {},
    series: [
      {
        name: '销量',
        type: 'bar',
        data: [5, 20, 36, 10, 10, 20],
      },
    ],
  };

  return <ECharts option={option} />;
};

API

EChartsCoreProps

名称 说明 类型 默认值
echarts echarts 模块 ECharts -
className 类名 string -
style 样式 React.CSSProperties -
option 图表的配置项和数据 EChartsCoreOption -
theme 应用的主题 EChartsTheme -
initOpts 初始化附加参数 EChartsInitOpts -
setOptionOpts 设置图表的配置项和数据附加参数 EChartsSetOptionOpts -
autoResize 自适应图表 boolean false
loading 是否显示加载动画 boolean -
loadingConfig 加载动画配置 EChartsLoadingConfig -
onChartInit 图表初始化时的回调 (echartsInstance: EchartsInstance) => void -
onEvents 图表事件 { [eventName: string]: (event: any) => void } -

EChartsProps

参考EChartsCoreProps,差异 API 如下:

名称 说明 类型 默认值
echarts echarts 模块 ECharts -
option 图表的配置项和数据 EChartsOption -

支持

  • 如果项目对你有帮助,请点颗星星:star:,谢谢。
  • 如果你对项目有想法、问题、BUG,欢迎讨论。
MIT License Copyright (c) 2021 twp0217 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Apache ECharts component for React(基于 React 的 Apache ECharts 组件) 展开 收起
TypeScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/twp0217/react-echarts.git
git@gitee.com:twp0217/react-echarts.git
twp0217
react-echarts
react-echarts
main

搜索帮助