mini-area.md 511 Bytes
Newer Older
nikogu's avatar
nikogu committed
1 2
---
order: 2
nikogu's avatar
nikogu committed
3
col: 2
nikogu's avatar
nikogu committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
title: 迷你区域图
---

````jsx
import { MiniArea } from 'ant-design-pro/lib/Charts';
import moment from 'moment';

const visitData = [];
const beginDay = new Date().getTime();
for (let i = 0; i < 20; i += 1) {
  visitData.push({
    x: moment(new Date(beginDay + (1000 * 60 * 60 * 24 * i))).format('YYYY-MM-DD'),
    y: Math.floor(Math.random() * 100) + 10,
  });
}

ReactDOM.render(
  <MiniArea
    line
    color="#cceafe"
    height={45}
    data={visitData}
  />
, mountNode);
````