效果:
当点击查看更多时,选择其中的复选框控制antv柱状图的显示条数
话不多说,直接上代码:
引入部分:’
import { DownOutlined } from '@ant-design/icons';
import { Column } from '@ant-design/plots';
import { Checkbox, Dropdown, message, Space } from 'antd';
import Styles from './index.less';
import { useEffect, useState } from 'react';
type Props = {
columnList: any;
};
定义好柱状图的mock数据:
const items = [
{
type: '1',
sales: 90,
isClick: false,
},
{
type: '2',
sales: 92,
isClick: false,
},
{
type: '3',
sales: 93,
isClick: false,
},
{
type: &#