Bar Segment
Used to display data as segments within a horizontal bar, showing proportions and part-to-whole relationships between values
AI TipWant to skip the docs? Use the MCP Server
500K
200K
100K
100K
Google
Bing
Direct
Yandex
Usage
import { BarSegment, Chart, useChart } from "@chakra-ui/charts"<BarSegment.Root>
<BarSegment.Content>
<BarSegment.Value />
<BarSegment.Bar />
<BarSegment.Label />
</BarSegment.Content>
</BarSegment.Root>Examples
Bar Size
Pass the barSize prop to the BarSegment.Root component to configure the size
of the bar.
Ruby
35%JavaScript
23%React
17%HTML
13%CSS
12%Legend
Use the BarSegment.Legend component to render the legend. You can pass
showPercent and showValue to control the visibility of the percentage and
values.
500K
200K
100K
100K
Bing
22%Direct
11%Yandex
11%Tooltip
Pass the tooltip prop to the BarSegment.Bar component to show a tooltip when
hovering over the bar.
Bing
22%Direct
11%Yandex
11%Reference
To reference a specific value on the chart, use the BarSegment.Reference
component.
500K
200K
100K
80K
Target
Google
Bing
Direct
Yandex