Instrument · Free · Recharts or ECharts
Composed chart: pick what's on it
Every option is a prop of the installed chart. The preview and the code use the same props, so what you copy is what you see.
Options, preview and code
Revenue and margin
Margin rose with revenue
322
Revenue · Q2 ’27
Up, a good sign
Revenue rose 77% from Q1 to Q2 ’27.
Show data table
| Quarter | Revenue | Margin % |
|---|
Code for this chart
"use client";
// Install: npx shadcn@latest add https://beautifulcharts.dev/r/instrument-composed-chart-recharts.json
import { ComposedChart } from "@/components/beautiful-charts/themes/instrument/recharts/composed-chart";
import type { ChartConfig } from "@/components/beautiful-charts/core/contracts";
const data = [
{ quarter: "Q1", revenue: 182, margin: 18 },
{ quarter: "Q2", revenue: 205, margin: 20 },
{ quarter: "Q3", revenue: 231, margin: 19 },
{ quarter: "Q4", revenue: 268, margin: 23 },
{ quarter: "Q1 ’27", revenue: 290, margin: 25 },
{ quarter: "Q2 ’27", revenue: 322, margin: 27 },
];
const config = {
revenue: { label: "Revenue", type: "bar" },
margin: { label: "Margin %", type: "line", axis: "right" },
} satisfies ChartConfig;
export function MyChart() {
return (
<ComposedChart
data={data}
config={config}
xKey="quarter"
eyebrow="Revenue and margin"
title="Margin rose with revenue"
/>
);
}