logo

Ant Design Charts

  • Manual
  • Components
  • Examples
  • Options
  • Productsantv logo arrow
  • 2.0.0
  • Common Configuration Statistical Charts
    • 标题(Title)
    • Axis
    • Legend
    • Scrollbar
    • Slider
    • Tooltip
    • Label
    • Color
    • event
    • Interaction
      • Overview
      • brushAxisHighlight
      • brushHighlight
      • brushXHighlight
      • brushYHighlight
      • brushFilter
      • brushXFilter
      • brushYFilter
      • chartIndex
      • elementHighlight
      • elementHighlightByColor
      • elementHighlightByX
      • elementSelect
      • elementSelectByColor
      • elementSelectByX
      • fisheye
      • legendFilter
      • legendHighlight
      • poptip
      • scrollbarFilter
      • sliderFilter
    • State
    • Style
    • Scale
      • overview
      • band
      • linear
      • log
      • ordinal
      • point
      • pow
      • quantile
      • quantize
      • sqrt
      • threshold
      • time
    • Animate
      • overview
      • fadeIn
      • fadeOut
      • growInX
      • growInY
      • morphing
      • pathIn
      • scaleInX
      • scaleInY
      • scaleOutX
      • scaleOutY
      • waveIn
      • zoomIn
      • zoomOut
    • Theme
      • overview
      • Academy
      • classic
      • classicDark
    • Data
      • overview
      • custom
      • ema
      • fetch
      • filter
      • fold
      • inline
      • join
      • kde
      • log
      • map
      • pick
      • rename
      • slice
      • sort
      • sortBy

event

Previous
Color
Next
Overview

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...

Ant Design Charts exposes some events to get the chart life cycle and interaction information. Ant Design Charts exports a ChartEvent type, used to define the type of event.

click event
{
onReady: ({ chart }) => {
chart.on('interval:click', (e) => {
console.log(e.data.data); // 展示点击的数据
});
chart.on('element:click', (e) => {
console.log(e.data.data); // 展示点击的数据
});
}
}

Interaction events

If you want to get the interactive information of the chart, you can do the following:

  • Monitor the global element event
chart.on(`element:${ChartEvent.EventType}`, (ev) => {
console.log(ev);
});
  • Monitor specified element event
chart.on(`${markType}:${ChartEvent.EventType}`, (ev) => {
console.log(ev);
});
chart.on(`interval:${ChartEvent.CLICK}`, (ev) => {
console.log(ev);
});
  • Listen to plot area events
chart.on('plot:click', (event) => console.log(event));
  • Listen to global component events
chart.on('component:click', (event) => console.log(event));
  • Listen to global label events
chart.on('label:click', (event) => console.log(event));

Click event

Event nameExplanationCallback parameters
ChartEvent.CLICKClickEvent
ChartEvent.DBLCLICKDouble clickEvent

Pointer event

Event nameExplanationCallback parameters
ChartEvent.POINTER_TAPEvent
ChartEvent.POINTER_DOWNWhen the pointer is pressedEvent
ChartEvent.POINTER_UPWhen the pointer is releasedEvent
ChartEvent.POINTER_OVERWhen the pointer enters the target elementEvent
ChartEvent.POINTER_OUTWhen the pointer leaves the target elementEvent
ChartEvent.POINTER_MOVEWhen the pointer changes coordinatesEvent
ChartEvent.POINTER_ENTERWhen the pointer enters the target element or its child elementsEvent
ChartEvent.POINTER_LEAVEWhen the pointer leaves the target element or its child elementsEvent
ChartEvent.POINTER_UPOUTSIDEEvent

Drag event

If you want to listen to drag events, you need to set the draggable and droppable properties.

{
"style": {
"droppable": true,
"draggable": true
}
}
Event nameExplanationCallback parameters
ChartEvent.DRAG_STARTWhen starting to dragEvent
ChartEvent.DRAGDuring draggingEvent
ChartEvent.DRAG_ENDWhen dragging is completeEvent
ChartEvent.DRAG_ENTERWhen the element is dragged into the target elementEvent
ChartEvent.DRAG_LEAVEWhen the element is dragged away from the target elementEvent
ChartEvent.DRAG_OVERWhen the element is dragged and hovered within the target elementEvent
ChartEvent.DROPWhen the element is placed inside the target elementEvent

Typical cases

For details, see Interaction - Events Examples