logo

Ant Design Charts

  • Manual
  • Options
  • Examples
  • Productsantv logo arrow
  • 2.0.0
  • Component Overview
  • Common Configuration Statistical Charts
    • Chart composition
    • Component
      • 标题(Title)
      • Axis
      • Legend
      • Scrollbar
      • Slider
      • Tooltip
      • Label
    • Core
      • Color En
      • View
      • Data
        • overview
        • custom
        • ema
        • fetch
        • filter
        • fold
        • inline
        • join
        • kde
        • log
        • map
        • pick
        • rename
        • slice
        • sort
        • sortBy
      • Scale
        • overview
        • band
        • linear
        • log
        • ordinal
        • point
        • pow
        • quantile
        • quantize
        • sqrt
        • threshold
        • time
      • Transform
        • overview
        • bin
        • binX
        • diffY
        • dodgeX
        • flexX
        • group
        • groupColor
        • groupX
        • groupY
        • jitter
        • jitterX
        • jitterY
        • normalizeY
        • pack
        • sample
        • select
        • selectX
        • selectX
        • sortColor
        • sortX
        • sortY
        • stackEnter
        • stackY
        • symmetryY
      • Coordinate
        • overview
        • fisheye
        • parallel
        • polar
        • radial
        • theta
        • transpose
        • cartesian3D
      • 样式(Style)
      • Animate
        • overview
        • fadeIn
        • fadeOut
        • growInX
        • growInY
        • morphing
        • pathIn
        • scaleInX
        • scaleInY
        • scaleOutX
        • scaleOutY
        • waveIn
        • zoomIn
        • zoomOut
      • 状态(State)
      • Interaction
        • Overview
        • brushAxisHighlight
        • brushHighlight
        • brushXHighlight
        • brushYHighlight
        • brushFilter
        • brushXFilter
        • brushYFilter
        • chartIndex
        • elementHighlight
        • elementHighlightByColor
        • elementHighlightByX
        • elementSelect
        • elementSelectByColor
        • elementSelectByX
        • fisheye
        • legendFilter
        • legendHighlight
        • poptip
        • scrollbarFilter
        • sliderFilter
      • Composition
        • overview
        • facetCircle
        • facetRect
        • repeatMatrix
        • spaceFlex
        • spaceLayer
        • timingKeyframe
      • Theme
        • overview
        • Academy
        • classic
        • classicDark
      • event
    • Specal Plot
      • Area
      • Bar
      • CirclePacking
      • DualAxes
      • Gauge
      • Line
      • Rose
      • Sankey
      • Scatter
      • Sunburst
      • Treemap
      • Venn
      • WordCloud
      • Column
      • Pie
      • BidirectionalBar
      • Box
      • Bullet
      • Funnel
      • Heatmap
      • Histogram
      • Liquid
      • Radar
      • Stock
      • Tiny
      • Violin
      • Waterfall
      • RadialBar
  • Relation Graph Components
    • Overview
    • MindMap
    • Fishbone
    • IndentedTree
    • Dendrogram
    • OrganizationChart
    • FlowGraph
    • FlowDirectionGraph
    • NetworkGraph
    • FAQ

event

Previous
classicDark
Next
Area

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
null;

Life cycle events

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

chart.on(ChartEvent.AFTER_RENDER, (ev) => {
console.log(ev);
});

Ant Design Charts currently provides the following lifecycle events:

Event nameExplanation
ChartEvent.BEFORE_RENDERBefore rendering
ChartEvent.BEFORE_PAINTBefore drawing
ChartEvent.AFTER_PAINTAfter drawing
ChartEvent.AFTER_RENDERAfter rendering
ChartEvent.BEFORE_CHANGE_DATABefore changing data
ChartEvent.AFTER_CHANGE_DATAAfter changing data
ChartEvent.BEFORE_CLEARBefore cleaning the canvas
ChartEvent.AFTER_CLEARAfter cleaning the canvas
ChartEvent.BEFORE_DESTROYBefore destroying the canvas
ChartEvent.AFTER_DESTROYAfter destroying the canvas
ChartEvent.BEFORE_CHANGE_SIZEBefore changing canvas size
ChartEvent.AFTER_CHANGE_SIZEAfter changing canvas size
  • Before rendering: Refers to Ant Design Charts starting to process data, perform layout, drawing graphics and other operations.
  • Before drawing: Refers to the completion of data processing, layout, graphics drawing and other operations, but has not yet been drawn.
  • After drawing: Refers to Ant Design Charts completing all drawing operations, but animation may exist. After the animation ends, the chart is truly rendered.
  • After rendering: Refers to Ant Design Charts completing all drawing operations, including animation.
  • After cleaning the canvas: The chart in the container has been cleaned up, but the Ant Design Charts instance still exists and can continue to be used.
  • After destroying the canvas: The Ant Design Charts instance has been destroyed and can no longer be used.

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