logo

Ant Design Charts

  • Manual
  • Components
  • Examples
  • Options
  • Productsantv logo arrow
  • 2.6.5
  • Component Overview
  • Statistical Charts
    • Chart overview
    • Line
    • Column
    • Bar Chart
    • Area
    • Pie Chart
    • DualAxes
    • Scatter
    • WordCloud
    • Funnel Chart
    • Heatmap
    • Histogram
    • Liquid
    • BidirectionalBar
    • Box
    • Bullet
    • CirclePacking
    • Gauge
    • Radar
    • Rose
    • Sankey
    • Stock
    • Sunburst
    • Treemap
    • Venn
    • Tiny
    • Violin
    • Waterfall
    • RadialBar
  • Relation Graph Components
    • Overview
    • MindMap
    • Fishbone
    • IndentedTree
    • Dendrogram
    • OrganizationChart
    • FlowGraph
    • FlowDirectionGraph
    • NetworkGraph
    • FAQ

Bar Chart

Previous
Column
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 2026 Ant Group Co., Ltd..备案号:京ICP备15032932号-38

Loading...

Introduction

A bar chart is a visualization that uses the width of rectangular bars to represent data magnitude, used to display comparisons between different categories or show data distribution. Its configuration is identical to Column and can be fully referenced.

Code Examples

For more examples, see Bar Chart

Basic Usage

Background Color

Grouped Bar Chart

Implemented through group: true, can be configured as an object to adjust group spacing.

Conversion Rate Bar Chart

Implemented through conversionTag.

conversionTag: {
size: 40,
spacing: 4,
text: {
formatter: (prev, next) => `${((next / prev) * 100).toFixed(1)}%`,
},
},

Reflected Bar Chart

Gantt Chart

Implemented through group: true, can be configured as an object to adjust group spacing.

Configuration

Common properties reference: Common Configuration

Overview

ConfigurationDescriptionTypeDefault
dataDataArray[]
xFieldX-axis fieldstring-
yFieldY-axis fieldstring | string[]-
seriesFieldField to distinguish multiple bar chartsstring (optional)-
colorFieldSimilar to seriesField, but adds color channel, see colorstring (optional)-
stackWhether bar chart is stackedboolean|Stackfalse
groupWhether bar chart is groupedboolean|Groupfalse
percentWhether bar chart shows as percentage in stacked statebooleanfalse
conversionTagConversion rate configurationconversionTag-
markBackgroundElement background configuration, no different from configuring bars, can be seen as a bar component placed at the bottom layer, needs scale.y.domain configuration to take effectMarkBackground-
titleUsed to specify chart title content, see Titleobject (optional)-
axisUsed to establish mapping between data and visual position, see Axisobject (optional)-
legendAuxiliary element of the chart, uses color, size, shape to distinguish different data types, used for filtering data in the chart, see Legendobject (optional)-
scrollbarUsed to filter data, can be bound to x or y channel, see Scrollbarobject (optional)-
sliderUsed to filter data, allows users to focus on local data at a time when there is a large amount of data, is an auxiliary component for viewing data, see Sliderobject (optional)-
labelData labels are one of the means to add annotations to the chart, see Labelobject (optional)-
tooltipUsed to dynamically display detailed information of data points, see Tooltipobject (optional)-
styleVisual style, configuration details see Drawing Propertiesobject (optional)-
themeUsed to control the overall appearance of the chart, including visual properties such as colors, fonts, margins, see Themestring | object (optional)light
onReadyChart load callback, used for subsequent event bindingFunction (optional)-
scaleMaps abstract data to visual data, see Scaleobject (optional)-
animateAnimation as an important part of visualization can significantly improve the expressiveness of data visualization, see Animationobject (optional)-
interactionProvides the ability to explore data on demand, see Interactionobject (optional)-
stateImplements interaction feedback, highlighting, selection and other effects, see State, chart styles under different interactionsobject (optional)-
annotationsView is like a drawing board, bar component draws a bar chart on it by default, we can overlay more layers on it through annotations, see AnnotationsArray (optional)-

Stack

PropertyDescriptionTypeDefault
groupBySpecify grouping channelstring | string[]x
orderBySpecify data for sortingTransformOrdernull
yData channel source selected by y channel'y'|'y1'y
y1Data channel source selected by y1 channel'y'|'y1'y1
reverseWhether to reverse orderbooleanfalse
seriesWhether there is a grouping fieldbooleantrue

Group

PropertyDescriptionTypeDefaultRequired
groupByChannel or channel combination for data groupingstring | string[]x
orderBySorting rule for elements within a groupTransformOrder() => null
reverseWhether to reverse the order of elements within a groupbooleanfalse
paddingSpacing between elements within a group (0 ~ 1)number0

ConversionTag

PropertyDescriptionTypeDefaultRequired
sizeIcon heightnumber40false
arrowSizeArrow sizenumber20false
spacingDistance from barboolean4false
textText configurationnumber0
styleIcon styleShapeAttrs-false
type Text = {
/** Text style */
style?: ShapeAttrs;
/** Text formatter */
formatter?: (prev: number, next: number) => string;
};

MarkBackground

type MarkBackground = {
/** background style */
style?: ShapeAttrs;
[key: string]: any
};

Events

See Options - Events.

Methods

See Chart Overview - Chart Methods.

FAQ

  1. How to set bar chart width?

There's a misconception here - Bar and Column have identical configurations, just with coordinate transposition, so all configurations are the same, please refer to Column.

style: {
minWidth: 20,
maxWidth: 20
}
  1. How to set spacing inside bars in stacking case spacing in stacking bar chart
style: {
insetRight: 2,
// stroke: '#fff',
// lineWidth: 2
}