hustcc a415b3075d
docs: readme & ga (#405)
* docs: update readme

* chore: add ga

* chore: add baidu tongji

* chore: remove baidu zhanzhang meta

* chore: update slogan
2021-02-10 15:01:53 +08:00

1.7 KiB

title order hero footer
ECharts for React - 全网开发者下载量最高的 ECharts 的 React 组件封装 1
title desc actions
ECharts for React 全网开发者下载量最高的 ECharts 的 React 组件封装
text link
在线实例 /examples/dynamic
text link
开源地址 https://github.com/hustcc/echarts-for-react
Open-source MIT Licensed | Copyright © 2021-present

安装

$ npm install echarts-for-react

使用

import React from 'react';
import ReactECharts from 'echarts-for-react';

const Page: React.FC = () => {
  const options = {
    grid: { top: 8, right: 8, bottom: 24, left: 36 },
    xAxis: {
      type: 'category',
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    },
    yAxis: {
      type: 'value',
    },
    series: [
      {
        data: [820, 932, 901, 934, 1290, 1330, 1320],
        type: 'line',
        smooth: true,
      },
    ],
    tooltip: {
      trigger: 'axis',
    },
  };

  return <ReactECharts option={options} />;
};

export default Page;

最终结果:

import React from 'react';
import ReactECharts from 'echarts-for-react';

const Page: React.FC = () => {
  const options = {
    grid: { top: 8, right: 8, bottom: 24, left: 36 },
    xAxis: {
      type: 'category',
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    },
    yAxis: {
      type: 'value',
    },
    series: [
      {
        data: [820, 932, 901, 934, 1290, 1330, 1320],
        type: 'line',
        smooth: true,
      },
    ],
    tooltip: {
      trigger: 'axis',
    },
  };

  return <ReactECharts option={options} />;
};

export default Page;

反馈

请访问 GitHub