API

:::warning{title="注意"} 维度下钻功能需要满足以下两个前置条件:

  • 透视表: 即 sheetType="pivot"
  • 树状模式: 即 hierarchyType="tree"

:::

React 下钻组件 <Badge>@antv/s2-react</Badge> <Badge>@antv/s2-react-components</Badge>

​查看示例

import { DrillDown } from '@antv/s2-react-components'; 
import '@antv/s2-react-components/dist/s2-react-components.min.css' 
 
const s2Options = { 
  width: 600, 
  height: 480, 
  hierarchyType: 'tree' 
}; 
 
<SheetComponent 
  sheetType="pivot" 
  options={s2Options} 
  partDrillDown={{ 
    render: (props) => <DrillDown {...props} />, 
    ...PartDrillDown 
  }} 
/> 
Vue 下钻组件 <Badge type="success">@antv/s2-vue</Badge>
公共 API