
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-chart-provider
Advanced tools
Built on JavaScript and TypeScript, all our charting or diagrams libraries work with any back-end database or server stack.
react-chart-provider is a lightweight, free, high-performance React wrapper for ReactChart with stock chart, diagram support. Perfect for financial data, time series, and interactive visualizations.
Features
Installation
npm install react-chart-provider
# or
yarn add react-chart-provider
Basic Usage
import React from 'react';
import { ReactChartWrapper } from 'react-chart-provider';
const MyStockChart = () => {
const options = {
// Your chart configuration
chart: {
type: 'line'
},
series: [{
data: [1, 2, 3, 4, 5]
}]
};
return (
<ReactChartWrapper
constructorType="stockChart"
options={options}
/>
);
};
export default MyStockChart;
Chart Configuration Example
import React, { useState } from 'react';
import { ReactChartWrapper } from 'react-chart-provider';
const StockChartExample = ({ graphData, curBillMonth, graphDataUOM }) => {
const [points, setPoints] = useState({ x: null, y: null });
const utcDate = new Date();
const options = {
chart: {
marginTop: 140,
height: 500,
spacingTop: 10,
spacingBottom: -60,
},
navigator: {
top: 60,
height: 60,
},
accessibility: {
enabled: false,
},
time: {
useUTC: true,
},
rangeSelector: {
buttons: [
{
type: 'week',
count: 1,
text: '1w',
},
{
type: 'all',
text: 'All',
},
],
inputEnabled: false,
selected: 0,
},
title: {
text: `Test`,
},
exporting: {
enabled: false,
},
xAxis: {
type: 'datetime',
tickInterval: 7 * 24 * 3600 * 1000,
labels: {
formatter: function() {
return ReactChart.dateFormat('%d-%m-%Y', this.value);
},
},
min: Date.UTC(utcDate.getFullYear(), utcDate.getMonth(), 1),
max: Date.UTC(utcDate.getFullYear(), utcDate.getMonth(), 8),
},
yAxis: {
title: {
text: 'Value',
},
opposite: false,
tickInterval: 1,
labels: {
formatter: function() {
return numberFormat(this.value);
},
},
},
tooltip: {
shared: false,
formatter: function() {
const date = ReactChart.dateFormat('%d-%m-%Y %H:%M:%S', this.x);
const value = this.points[0].y;
const formattedValue = value.toFixed(3);
return `${date}<br/><b>Value: ${formattedValue}</b> (${graphDataUOM})`;
},
},
scrollbar: {
enabled: false,
},
series: [{
name: 'value',
data: graphData,
lineWidth: 1.2,
point: {
events: {
click: function() {
const date = ReactChart.dateFormat('%d/%m/%Y %H:%M:%S', this.x);
setPoints({ x: date, y: this.y });
setTimeout(() => setPoints({ x: null, y: null }), 1000);
},
},
},
}],
credits: { enabled: false },
};
return (
<div>
<ReactChartWrapper
constructorType="stockChart"
options={options}
/>
{points.x && (
<div className="tooltip">
Selected: {points.x}, Value: {points.y}
</div>
)}
</div>
);
};
export default StockChartExample;
API Reference Props
| Prop | Type | Required | Description |
|---|---|---|---|
constructorType | string | No | Chart type ('chart', 'stockChart', 'mapChart') |
options | Object | Yes | ReactChart configuration options |
ReactChart | Object | No | ReactChart instance (for custom builds) |
allowChartUpdate | boolean | No | Allow chart updates (default: true) |
updateArgs | Array | No | Update arguments ([redraw, animation, updatePoints]) |
containerProps | Object | No | Container div props |
Methods
Access methods via ref:
const chartRef = useRef();
<ReactChartWrapper ref={chartRef} {...props} />
// Then call:
chartRef.current.chart.update(options); // Update chart
chartRef.current.chart.destroy(); // Destroy chart
Time Series Formatting
xAxis: {
type: 'datetime',
labels: {
formatter: function() {
return ReactChart.dateFormat('%Y-%m-%d', this.value);
}
}
}
Tooltip Customization
tooltip: {
formatter: function() {
return `<b>${this.series.name}</b><br/>` +
ReactChart.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
`Value: <b>${this.y.toFixed(2)}</b>`;
}
}
Responsive Configuration
responsive: {
rules: [{
condition: {
maxWidth: 500
},
chartOptions: {
legend: {
enabled: false
}
}
}]
}
Performance Tips
Disable animations for large datasets:
plotOptions: {
series: {
animation: false
}
}
Use turbo threshold for performance with >1000 points:
series: [{
turboThreshold: 5000
}]
Batch updates when data changes frequently:
// Instead of multiple setStates, update once:
chartRef.current.chart.update({ series: [{ data: newData }] });
License
MIT © 2022-2025
FAQs
Built on JavaScript and TypeScript, all our charting or diagrams libraries work with any back-end database or server stack.
We found that react-chart-provider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.