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

0.2.3 • Public • Published

echarts-with-react

Usage

import Chart from 'echarts-with-react';
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { LineChart } from 'echarts/charts'
import { GridComponent } from 'echarts/components'

use([CanvasRenderer, LineChart, GridComponent])

const App = () => {
  return (
    <Chart 
      option={{
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [150, 230, 224, 218, 135, 147, 260],
            type: 'line'
          }
        ]
      }} 
      style={{ height: 400 }}
      onClick={(params) => console.log('params:', params)}
    />
  )
}

export default App

Readme

Keywords

Package Sidebar

Install

npm i echarts-with-react

Weekly Downloads

0

Version

0.2.3

License

MIT

Unpacked Size

7.62 kB

Total Files

6

Last publish

Collaborators

  • linyxria