1.0.0 • Published 8 months ago

@trans.js/use-echarts v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

@trans.js/use-echarts

示例

import { useEcharts } from '@trans.js/use-echarts';
// const { useEcharts } = require('@trans.js/use-echarts');

const demo = () => {
  const [ecReady, setEcReady] = useState(false);
  const [chartInst, Echart ] = useEcharts();

  useEffect(()=>{
    if(ecReady){
      chartInst.setOption(option)
    }
  }, [ecReady])

  return (
    <>
      <Echart onReady={chart=>{
        setEcReady(true)
      }}/>
    </>
  )
}

安装

pnpm i @trans.js/use-echarts
# 或者
yarn add @trans.js/use-echarts
1.0.0

8 months ago