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

BaseTooltip

Previous
Node
Next
BaseFacet

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: Tooltip class. details

s2.tooltip.show({
position: {
x: 0,
y: 0,
},
content: 'xxx'
})
parameterillustratetype
spreadsheetForm example() => SpreadSheet
containertooltip mount containerHTMLElement
optionstooltip configurationTooltipShowOptions
positioncoordinate{ x: number, y: number }
visibleDisplay stateboolean
showshow tooltip(showOptions: TooltipShowOptions ) => void
hidehide tooltip() => void
destroyDestroy the tooltip, and remove the mounted container() => void
clearContentEmpty tooltip content() => void
disablePointerEventDisable tooltip mouse response() => void

TooltipShowOptions

object is required , default: null Function description: tooltip display configuration

parametertyperequiredDefaultsFunctional description
positionTooltipPosition✓tooltip display location
dataTooltipDatatooltip data
cellInfosRecord<string, any>cell information
optionsTooltipOptionsTooltip part configuration
contentReactNode | string | or (cell, defaultTooltipShowOptions: TooltipShowOptions) => ReactNode | stringCustomize tooltip content
eventEventCurrent event Event

TooltipPosition

object is required , default: null Function description: tooltip coordinates

parametertyperequiredDefaultsFunctional description
xnumber✓Abscissa
the ynumber✓Y-axis

TooltipData

object optional , default: null function description: tooltip data

parametertyperequiredDefaultsFunctional description
summariesTooltipSummaryOptionsList of selected item statistics (differentiated by measure value)
detailsListItemData Point Details
headInfoTooltipHeadInfolist of axes (row/column headers)
namestringcurrent cell name
tipsstringTips/Instructions
infosstringPrompt information at the bottom (can be used for shortcut key operation prompts)

TooltipSummaryOptions

object is optional , default: null Function description: tooltip List of selected item statistics (differentiated by measurement value)

parametertyperequiredDefaultsFunctional description
namestring✓name
valuenumber | string✓value
selectedDataRecord<string, any>✓currently selected data list

TooltipHeadInfo

object optional , default: null function description: tooltip axis (row/column header) list

parametertyperequiredDefaultsFunctional description
rowsListItem✓List of outfits
colsListItem✓header list

ListItem

object optional , default: null function description: tooltip data point detail data

parametertyperequiredDefaultsFunctional description
namestring✓name
valuestring | number✓value
iconReactNodecustom icon component

TooltipOptions

object is required , default: null Function description: tooltip partial configuration

parametertyperequiredDefaultsFunctional description
hideSummarybooleanfalseWhether to hide selected item statistics
operatorTooltipOperatorOptionsAction Bar Configuration
onlyShowOperatorbooleanfalseWhether tooltip only shows action menu items
isTotalsbooleanfalseIs it a total/subtotal cell
onlyShowCellTextbooleanfalseWhether to display cell prompt information
enableFormatbooleanfalseWhether to enable formatting
forceRenderbooleanfalseWhether to force the dom to be cleared

TooltipOperatorOptions

object optional , default: null Function description: tooltip operation bar configuration

parametertyperequiredDefaultsFunctional description
menusTooltipOperatorMenu[]action item list
onClick({ item, key, keyPath, domEvent }) => voidClick event, transparently transmit onClick of antd Menu component
selectedKeysstring[]Initially selected menu item key array, transparently transmit the selectedKeys of the antd Menu component
TooltipOperatorMenu

object is required , default: null Function description: tooltip list of operation items

parametertyperequiredDefaultsFunctional description
keystring✓Uniquely identifies
textReactNode | stringname
iconReactNode | stringcustom icon
visibleboolean | (cell) => booleantrueWhether the operation item is displayed, you can pass in a function to dynamically display it according to the current cell information
onClick( cell : S2CellType : ) => voidClick event callback (cell is the cell corresponding to the current tooltip)
childrenTooltipOperatorMenusubmenu list