sparklines文档 http://borisyankov.github.io/react-sparklines
sparklines缺点:鼠标 hover没有 tooltip

  1. npm install react-sparklines

antdpro minibar

minibar文档 https://v2-pro.ant.design/components/charts-cn
image.png

刻度线可视化组件

  1. 类似折线的刻度线组件 https://github.com/MrXujiang/ticker

刻度线.png

sparklines 折线图

sparklines-MiniChart - 图3

  1. import React from 'react';
  2. import { Sparklines, SparklinesLine } from 'react-sparklines';
  3. ...
  4. <Sparklines data={[5, 10, 5, 20]}>
  5. <SparklinesLine color="blue" />
  6. </Sparklines>

sparkslines 柱图

sparklines-MiniChart - 图4

  1. import React from 'react';
  2. import { Sparklines, SparklinesBars } from 'react-sparklines';
  3. ...
  4. <Sparklines data={[5, 10, 5, 20]}>
  5. <SparklinesBars />
  6. </Sparklines>

sparklines 点图

sparklines-MiniChart - 图5

  1. import React from 'react';
  2. import { Sparklines, SparklinesLine, SparklinesSpots } from 'react-sparklines';
  3. ...
  4. <Sparklines data={sampleData}>
  5. <SparklinesLine style={{ fill: "none" }} />
  6. <SparklinesSpots />
  7. </Sparklines>

sparklines 基准线图

sparklines-MiniChart - 图6

  1. import React from 'react';
  2. import { Sparklines, SparklinesLine, SparklinesReferenceLine } from 'react-sparklines';
  3. ...
  4. <Sparklines data={sampleData}>
  5. <SparklinesLine />
  6. <SparklinesReferenceLine type="mean" />
  7. </Sparklines>

sparklines 阴影图

sparklines-MiniChart - 图7

  1. import React from 'react';
  2. import { Sparklines, SparklinesLine, SparklinesNormalBand } from 'react-sparklines';
  3. ...
  4. <Sparklines data={sampleData}>
  5. <SparklinesLine style={{ fill: "none" }}/>
  6. <SparklinesNormalBand />
  7. </Sparklines>

sparklines-MiniChart - 图8

  1. import React from 'react';
  2. import { Sparklines } from 'react-sparklines';
  3. ...
  4. <Sparklines data={[5, 10, 5, 20, 8, 15]} limit={5} width={100} height={20} margin={5}>
  5. </Sparklines>

sparklines动态图

sparklines-MiniChart - 图9