Reach + Echarts 模拟实现一个大概类似的。
安装命令
yarn add echarts echarts-for-react
或者
npm install --save echarts echarts-for-react
初始使用
import React from 'react';
import ReactEcharts from 'echarts-for-react';
import './index.css'
export default class Line extends React.Component {getOption = () => {let option = {tooltip: {trigger: 'item'},legend: {top: '5%',left: 'center'},series: [{name: 'Access From',type: 'pie',radius: ['40%', '70%'],avoidLabelOverlap: false,label: {show: false,position: 'center'},emphasis: {label: {show: true,fontSize: '40',fontWeight: 'bold'}},labelLine: {show: false},data: [{ value: 1048, name: 'Search Engine' },{ value: 735, name: 'Direct' },{ value: 580, name: 'Email' },{ value: 484, name: 'Union