Skip to main content

Combined Chart

A combined bar + line chart component built using Recharts v3. Overlay bars and lines in a single chart for comparative analysis.

Installation

$ npx shadcn@latest add @orecus/combined-chart
Registry:
@orecus/chart@orecus/color-utils@orecus/chart-utils@orecus/card

Component

Revenue & Profit Margin

Monthly revenue with profit margin trend

With Reference Lines

Revenue target and margin threshold

Props

PropTypeDefaultDescription
data*any[]The data for the chart
index*stringKey in data to use for x-axis
barCategories*string[]Keys in data to render as bars
lineCategories*string[]Keys in data to render as lines
barColorsThemeColor[]Colors for bar series
lineColorsThemeColor[]Colors for line series
stackedbooleanfalseStack bar series
showDotsbooleantrueShow dots on lines
connectNullsbooleanfalseConnect lines across null/undefined values
showDataLabelsbooleanfalseShow value labels directly on chart elements
barRadiusnumber4Corner radius for bars
cardPropsCardPropsProps to pass to the underlying Card component
tooltipSortByValuebooleanfalseSort tooltip items by value (descending)
tooltipShowTotalbooleanfalseShow total in tooltip for multi-series
tooltipTotalLabelstring'Total'Label for the total row in tooltip
legendIndicator'square' | 'circle' | 'line''square'Shape of legend indicators
interactiveLegendbooleanfalseAllow clicking legend items to toggle series visibility
legendWrapbooleantrueAllow legend items to wrap to multiple lines
xAxisFormatter(value: string) => stringFormatter for x-axis tick labels and tooltip header
xAxisTickSVGProps | ReactElement | ((props) => ReactNode) | booleanCustom tick rendering for the x-axis — overrides xAxisFormatter when set
yAxisFormatter(value: number) => stringFormatter for y-axis tick labels — falls back to valueFormatter
yAxisTickSVGProps | ReactElement | ((props) => ReactNode) | booleanCustom tick rendering for the y-axis — overrides yAxisFormatter when set
referenceLinesChartReferenceLine[]Reference lines (targets, thresholds, averages) rendered on the chart