<tyro-ui-bar-chart>

Bar Chart

Vertical bar chart for a single series (e.g. visits per day), with a subtle grid and a tooltip per bar.

Visits per day (30 days)

Hover a bar · days without visits = 0

Few bars

6 months · [height]=180

Empty

[items]=[]

No data


Inputs

Property
Type
Default
Description
[items]ITyroUiBarChartItem[][]Bars: { label, value, details? }. details adds rows to the tooltip ({ label, value }).
[valueLabel]string''Value name in the tooltip (e.g. "visits")
[height]number220Plot area height in px
[emptyLabel]string'Aucune donnée'Message when every value is 0

Design rules

  • A single series, so one colour and no legend: the card title names the series.
  • Bars 24px max, rounded at the top only, 2px apart.
  • Y axis with round ticks (1, 2, 2.5, 5 × 10ⁿ), subtle grid.
  • Beyond 8 bars, one X label out of N to avoid overlaps.
  • One tooltip per bar on hover and keyboard focus (the whole column is the target).

Usage

<tyro-ui-bar-chart
  [items]="days()"
  valueLabel="visites"
  emptyLabel="Aucune visite sur cette période.">
</tyro-ui-bar-chart>

// days = [{ label: '04 oct.', value: 114, details: [{ label: 'uniques', value: 17 }] }, ...]