DDS/Components/BarChart

BarChart

Charts

An SVG bar chart with grouped multi-series, grid, hover tooltips, optional value labels, and a legend.

Props

PropTypeDefaultDescription
labels*string[]X-axis labels.
datasets*DsBarChartDataset[]Each dataset: { label, data, color? }.
showGridbooleantrueHorizontal grid lines.
showValuesbooleanfalseDisplay value above each bar.
showLegendbooleantrueLegend for multiple datasets.
groupedbooleantrueGroup datasets side by side.
heightnumber240Chart height.

Examples

Grouped bars
025,58751,17576,762102,350Q1Q2Q3Q4
2024
2025
vue
<DsBarChart
  :labels="['Q1', 'Q2', 'Q3', 'Q4']"
  :datasets="[
    { label: '2024', data: [42000, 58000, 51000, 73000] },
    { label: '2025', data: [54000, 67000, 62000, 89000] },
  ]"
  :show-grid="true"
  :show-values="false"
/>
With value labels
080160240320142198165231214278JanFebMarAprMayJun
vue
<DsBarChart
  :labels="['Q1', 'Q2', 'Q3', 'Q4']"
  :datasets="[
    { label: '2024', data: [42000, 58000, 51000, 73000] },
    { label: '2025', data: [54000, 67000, 62000, 89000] },
  ]"
  :show-grid="true"
  :show-values="false"
/>

Skeleton

Use DsBarChartSkeleton as a loading placeholder while content is being fetched.

Default (6 bars)
vue
<DsBarChartSkeleton
  :bars="6"
  :height="240"
/>

Accessibility

  • Hover tooltip shows exact values for screen content.