Composed chart
Bars and a line on one plot with two value axes: the bars’ axis at inline-start (the right in RTL) and the line’s facing it; one frosted tooltip reads both.
Real scenarios
The component as it is used in a product — not a specimen grid.
Revenue against conversion
Two quantities in different units share one plot: the bars read on the start axis (million tomans), the line on the end axis (percent, via line-format). On a Persian page the bars’ axis moves to the right and the months run right to left. One frosted tooltip reads both; the markers name conversion’s best and worst month.
Revenue & checkout conversion
Online store · 8 months
- Revenue
- Conversion
| Revenue | Conversion | |
|---|---|---|
| Apr | 412 | 0.02 |
| May | 456 | 0.02 |
| Jun | 498 | 0.03 |
| Jul | 471 | 0.02 |
| Aug | 532 | 0.03 |
| Sep | 588 | 0.03 |
| Oct | 610 | 0.03 |
| Nov | 664 | 0.03 |
Ticket volume and response time
Two bar series (new vs reopened tickets) sit side by side on the start axis while the median first response, in minutes, rides the end axis — the busy Monday is where the line peaks.
Support desk
- New
- Reopened
- First response (min)
| New | Reopened | First response (min) | |
|---|---|---|---|
| Sat | 132 | 18 | 6.20 |
| Sun | 148 | 22 | 7.10 |
| Mon | 196 | 31 | 11.40 |
| Tue | 171 | 26 | 8.90 |
| Wed | 158 | 19 | 7.60 |
| Thu | 120 | 15 | 5.80 |
| Fri | 84 | 9 | 4.90 |
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| labels / bars / lines | array | [] | Bars on the primary axis, lines on the secondary; line colours continue after the bars. |
| bar-axis / line-axis | string | null | A small title over each axis. |
| format / line-format | array | null | Intl.NumberFormat per axis — e.g. ['style' => 'percent'] for a conversion rate. |
| markers / ping / dir | bool / bool / string | false / true / auto | High / low of the first line, the ping on its last point, and a forced direction. |
Snippet
<x-nx::composed-chart title="درآمد و نرخ تبدیل" :labels="$months"
:bars="[['name' => 'درآمد', 'values' => $revenue]]"
:lines="[['name' => 'نرخ تبدیل', 'values' => $conversion]]"
bar-axis="میلیون تومان" line-axis="٪" :line-format="['style' => 'percent', 'maximumFractionDigits' => 1]" markers />