Multi-Line Chart
Compare multiple time-series financial metrics simultaneously. Features revenue, expenses, and net profit margins with glowing data points.
◆Multiple Series with Contrasting Line Aesthetics
Distinguish primary metrics from secondary indicators by combining solid thick strokes (strokeWidth={3}), secondary thinner solid strokes (strokeWidth={2.5}), and dashed helper strokes (strokeDasharray='4 4') for expenses or benchmarks.
<Line type="monotone" dataKey="revenue" stroke="#00e5a0" strokeWidth={3} dot={{ r: 4.5, stroke: '#00e5a0', fill: '#00e5a0' }} />
<Line type="monotone" dataKey="netProfit" stroke="#4a9eff" strokeWidth={2.5} dot={{ r: 4, stroke: '#4a9eff', fill: '#4a9eff' }} />
<Line type="monotone" dataKey="expenses" stroke="#ff6b6b" strokeWidth={2} strokeDasharray="4 4" dot={{ r: 4, stroke: '#ff6b6b', fill: '#ff6b6b' }} />◆Custom Hover Active Dot Halos
Provide tactile visual feedback on hover using activeDot with a contrasting white stroke halo around the primary series color.
activeDot={{ r: 7, stroke: '#ffffff', fill: '#00e5a0', strokeWidth: 2 }}A Multi-Line Chart is ideal for developers and designers who need to display data clearly and effectively. Use this chart type when:
- ✓Showing trends over time (e.g. daily active users over 30 days)
- ✓Comparing multiple metrics on the same timeline
- ✓Displaying continuous data like temperature, stock prices, or heart rate
- ✓Highlighting growth rates and momentum
What is a multi line chart and when should you use it?
A multi line chart plots two or more continuous data series on the same set of coordinate axes. It is ideal for financial performance tracking (such as Revenue vs Expenses vs Net Margin), competitive benchmarking, and multi-sensor telemetry.
How many lines should you put on a multi line chart?
Best practice is to limit multi line charts to 3 to 5 distinct series. Including more than 5 series creates visual clutter (a 'spaghetti chart') that degrades readability. For datasets with 6+ series, consider small multiples or interactive series toggles.
How do you style different lines in Recharts?
Configure contrasting stroke colors, distinct strokeWidth values (e.g. 3px for primary revenue, 2px for secondary expenses), strokeDasharray='4 4' for projected benchmarks, and colored dot markers.