react-echarts-pro
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

react echarts

feature:

  • typescript support
  • echarts v5.0 support
  • build with react hooks

Get started

const App = () => {
  const option = React.useMemo(() => {
    return {
      title: {
        text: 'chart title',
      },
      tooltip: {},
      legend: {
        data: ['sales'],
      },
      xAxis: {
        data: ['apple', 'Banana', 'Cherry', 'Grape', 'Peach', 'Strawberry'],
      },
      yAxis: {},
      series: [
        {
          name: 'sales',
          type: 'bar',
          data: [5, 20, 36, 10, 10, 20],
        },
      ],
    };
  }, []);

  const style = React.useMemo(() => {
    return { height: 300, width: '100%' };
  }, []);

  return <ReactEchart options={option} style={style}/>
};

Readme

Keywords

none

Package Sidebar

Install

npm i react-echarts-pro

Weekly Downloads

3

Version

0.1.3

License

MIT

Unpacked Size

34.2 kB

Total Files

21

Last publish

Collaborators

  • evle