logo

S2

  • Manual
  • API
  • Examples
  • Playground
  • ChangeLog
  • Productsantv logo arrow
  • 2.x
  • Common Configuration
    • S2DataConfig
    • S2Options
      Updated
    • S2Theme
      Updated
    • S2Event
  • Basic Class
    • SpreadSheet
    • Interaction
      Updated
    • Store
    • BaseCell
      Updated
    • BaseDataSet
    • Node
    • BaseTooltip
    • BaseFacet
      Updated
    • Hierarchy
      New
    • BaseBBox
      New
    • CellData
      New
  • Components
    • table component
    • DrillDown
    • Switcher
    • Advanced Sort
    • Export
      Updated
  • Graphic style
  • 透视组合图拓展 S2Options

BaseDataSet

Previous
BaseCell
Next
Node

Resources

Ant Design
Galacea Effects
Umi-React Application Framework
Dumi-Component doc generator
ahooks-React Hooks Library

Community

Ant Financial Experience Tech
seeconfSEE Conf-Experience Tech Conference

Help

GitHub
StackOverflow

more productsMore Productions

Ant DesignAnt Design-Enterprise UI design language
yuqueYuque-Knowledge creation and Sharing tool
EggEgg-Enterprise-class Node development framework
kitchenKitchen-Sketch Tool set
GalaceanGalacean-互动图形解决方案
xtechLiven Experience technology
© Copyright 2025 Ant Group Co., Ltd..备案号:京ICP备15032932号-38

Loading...

Function description: tabular data set. details

s2.dataSet.getFieldName('type')
parameterillustratetypeVersion
fieldsfield information() => Fields
metaField meta information, including field name, formatting, etc.() => Meta[]
originDataRaw data() => DataType[]
totalDatasummary data() => DataType[]
indexesDatamultidimensional index data() => DataType[]
sortParamssort configuration() => SortParams
spreadsheetForm example() => SpreadSheet
getFieldMetaGet field metadata information(field: string, meta?: Meta[] ) => Meta
getFieldNameget field name() => string
getFieldFormatterGet the field formatting function() => (v: string) => unknown
getFieldDescriptionGet field description() => string
setDataCfgSet data configuration<T extends boolean = false>(dataCfg: T extends true ? S2DataConfig : Partial<S2DataConfig>, reset?: T) => voidThe reset parameter needs to be used in @antv/s2^1.34.0 version
getDisplayDataSetGet the currently displayed dataset() => DataType[]
getDimensionValuesget dimension value(filed: string, query?: DataType ) => string[]
getCellDataGet a single cell data(params: CellDataParams ) => DataType[]
getMultiDataGet bulk cell data(query: DataType,params?: MultiDataParams) => DataType[]
getMultiData(deprecated)Get bulk cell data(query: DataType , isTotals?: boolean, isRow?: boolean, drillDownFields?: string[], includeTotalData:boolean) => DataType[]
moreThanOneValueIs there more than 1 value() => ViewMeta

DataType

type DataType = Record<string, unknown>;

CellDataParams

interface CellDataParams {
// search query
query: DataType;
isTotals?: boolean;
// use in part drill-down
rowNode?: Node;
// mark row's cell
isRow?: boolean;
}

MultiDataParams

interface MultiDataParams {
drillDownFields?: string[]; // drill down dimensions
queryType?: QueryDataType; // query type, get all data by default
}
enum QueryDataType {
All = 'all', // get all data, include total data
DetailOnly = 'detailOnly', // only get detail data
}