0.0.9 • Published 9 months ago

echarts-rc v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

echarts-rc

The React wrapper for Apache ECharts.

Purpose

Why we have one more wrapper for echarts?

  1. Use of the Resize Observer API to auto resize.
  2. Full access to all echarts features.
  3. Use of modern react.

Attributes

How to Use

Step 1.

npm i echarts-rc

# `echarts` is the peerDependence of `echarts-rc`, you can install echarts with your own version.
npm i echarts

Step 2.

import { useMemo } from "react";
import EChartsComponent, { EChartsOption } from "echarts-rc";

function App() {
  const options: EChartsOption = useMemo(
    () => ({
      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",
        },
      ],
    }),
    []
  );

  return (
    <EChartsComponent
      option={options}
      opts={{ notMerge: true }}
      style={{ height: 500 }}
      onInit={(instance) => {
        instance.on("click", (e) => {
          console.log(e);
        });
      }}
    />
  );
}

export default App;
0.0.9

9 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago

0.0.0

10 months ago