d3, chart.js, recharts, @visx/visx, and react-vis are all tools for rendering data visualizations in web applications, but they operate at different levels of abstraction. d3 is a low-level powerhouse for manipulating documents based on data, offering maximum flexibility but requiring more code. chart.js is a canvas-based library focused on simplicity and standard chart types. recharts and react-vis are React-specific wrappers that simplify chart creation using declarative components. @visx/visx sits in the middle, providing low-level React components powered by d3 that allow for custom designs without the overhead of a full charting framework.
When building dashboards or data-heavy interfaces in React, picking the right visualization library can make or break your project. d3, chart.js, recharts, @visx/visx, and react-vis all solve the same problem — turning numbers into pictures — but they do it in very different ways. Some give you full control, while others prioritize speed and simplicity. Let's break down how they handle real-world engineering tasks.
The underlying technology determines how your charts look and perform. SVG is great for interactivity and crisp scaling, while Canvas is better for raw performance with massive datasets.
d3 primarily manipulates SVG elements directly.
// d3: Appending SVG circles
svg.selectAll("circle")
.data(data)
.enter()
.append("circle")
.attr("cx", d => xScale(d.x))
.attr("cy", d => yScale(d.y));
chart.js renders on an HTML5 Canvas element.
// chart.js: Configuring a canvas chart
new Chart(ctx, {
type: 'line',
data: { datasets: [{ data: [10, 20, 30] }] },
options: { responsive: true }
});
recharts builds on top of SVG using React components.
// recharts: Declarative SVG components
<LineChart width={500} height={300} data={data}>
<Line dataKey="value" stroke="#8884d8" />
<XAxis dataKey="name" />
</LineChart>
@visx/visx uses SVG primitives wrapped in React.
d3, but you write JSX instead of DOM manipulation.// @visx/visx: Rendering bars with SVG
<svg width={width} height={height}>
{data.map((d) => (
<rect
key={d.key}
x={xScale(d.key)}
y={height - yScale(d.value)}
width={barWidth}
height={yScale(d.value)}
/>
))}
</svg>
react-vis also uses SVG components.
recharts but with a different component API.@visx/visx.// react-vis: XYPlot component
<XYPlot width={500} height={300}>
<XAxis />
<YAxis />
<LineSeries data={data} />
</XYPlot>
How you write code changes drastically between low-level libraries and React wrappers. Imperative means telling the library step-by-step what to do. Declarative means describing what you want the result to look like.
d3 is fully imperative.
useEffect hooks to integrate with React.// d3: Manual DOM manipulation in useEffect
useEffect(() => {
const svg = d3.select(ref.current);
svg.selectAll("rect").data(data).join("rect");
}, [data]);
chart.js is imperative but instance-based.
// chart.js: Updating chart instance
chartRef.current.data.datasets[0].data = newData;
chartRef.current.update();
recharts is fully declarative.
// recharts: Data passed as props
<BarChart data={data}>
<Bar dataKey="sales" fill="#82ca9d" />
</BarChart>
@visx/visx is declarative but low-level.
recharts, but more control.// @visx/visx: Manual scale calculation in JSX
const xScale = scaleBand({ domain, range });
{data.map(d => <rect x={xScale(d.key)} />)}
react-vis is declarative with higher abstraction.
recharts but with fewer customization hooks.// react-vis: High-level plot declaration
<SunburstDiagram data={treeData} />
Some libraries give you a finished car; others give you an engine and wheels. Your choice depends on whether you need a standard chart or a unique design.
d3 provides building blocks only.
// d3: Creating a scale from scratch
const x = d3.scaleLinear().domain([0, 10]).range([0, 100]);
chart.js offers preset chart types.
// chart.js: Configuring preset options
options: {
scales: { y: { beginAtZero: true } },
plugins: { legend: { position: 'top' } }
}
recharts provides composable preset parts.
// recharts: Customizing tooltip content
<Tooltip content={<CustomTooltip />} />
@visx/visx gives you unstyled building blocks.
// @visx/visx: Applying custom styles to shapes
<Bar fill={theme.colors.primary} radius={4} />
react-vis offers opinionated presets.
// react-vis: Using built-in grid lines
<VerticalGridLines />
<HorizontalGridLines />
A library is only as good as its support. If a package stops getting updates, it becomes a risk for your project.
d3 is the industry standard.
chart.js is widely adopted and stable.
recharts is the React community favorite.
@visx/visx is maintained by Airbnb.
react-vis is effectively deprecated.
recharts or @visx/visx instead.| Feature | d3 | chart.js | recharts | @visx/visx | react-vis |
|---|---|---|---|---|---|
| Rendering | SVG | Canvas | SVG | SVG | SVG |
| Style | Imperative | Imperative | Declarative | Declarative | Declarative |
| Learning Curve | Steep | Low | Low | Medium | Low |
| Customization | Unlimited | Low | Medium | High | Medium |
| Status | ✅ Active | ✅ Active | ✅ Active | ✅ Active | ⚠️ Inactive |
d3 is the engine under the hood. Use it when you need to invent a new type of chart that doesn't exist yet.
chart.js is the reliable workhorse. Use it when you need to display lots of data points quickly and don't need complex interactions.
recharts is the rapid development tool. Use it when you need to ship a dashboard next week and standard charts are fine.
@visx/visx is the designer's toolkit. Use it when you need custom charts that match your brand exactly but still want React components.
react-vis is the legacy option. Avoid it for new work. It served its purpose, but the ecosystem has moved on to more flexible and maintained tools.
Final Thought: There is no single "best" library. If you value speed, pick recharts. If you value design control, pick @visx/visx. If you value raw performance, pick chart.js. Just avoid react-vis to save yourself future maintenance headaches.
Choose chart.js if you need a quick, reliable solution for standard charts like bars, lines, and pies without worrying about SVG details. It is best for projects where performance on large datasets is critical due to its Canvas rendering. Note that you will need a React wrapper like react-chartjs-2 to integrate it cleanly.
Choose @visx/visx if you need the power of d3 but want to build reusable React components with full control over the SVG. It is ideal for design systems or highly custom visualizations where standard chart libraries feel too rigid. Be prepared to write more boilerplate code compared to higher-level wrappers.
Choose d3 if you require complete control over every pixel and interaction, or if you are building non-standard visualizations like complex maps or network graphs. It is the best choice for data-heavy applications where performance and customization outweigh development speed. Avoid it for simple dashboards where a higher-level library would suffice.
Avoid choosing react-vis for new projects as it is no longer actively maintained and has been effectively superseded by other options. It was useful for quick Uber-style dashboards in the past, but lacks the modern features and community support of recharts or @visx/visx. Evaluate recharts or @visx/visx instead for better long-term stability.
Choose recharts if you want a declarative, React-native experience for building standard dashboards quickly. It is perfect for teams that prioritize developer speed and ease of use over pixel-perfect customization. It handles responsive resizing and tooltips out of the box with minimal configuration.
Simple yet flexible JavaScript charting for designers & developers
All the links point to the new version 4 of the lib.
In case you are looking for an older version of the docs, you will have to specify the specific version in the url like this: https://www.chartjs.org/docs/2.9.4/
Instructions on building and testing Chart.js can be found in the documentation. Before submitting an issue or a pull request, please take a moment to look over the contributing guidelines first. For support, please post questions on Stack Overflow with the chart.js tag.
Chart.js is available under the MIT license.