Charts plus JS behaviour

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 & checkout conversion
RevenueConversion
Apr4120.02
May4560.02
Jun4980.03
Jul4710.02
Aug5320.03
Sep5880.03
Oct6100.03
Nov6640.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)
Support desk
NewReopenedFirst response (min)
Sat132186.20
Sun148227.10
Mon1963111.40
Tue171268.90
Wed158197.60
Thu120155.80
Fri8494.90

Important props

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 />