Animated React charting library powered by D3 with smooth data transitions and interactive features
npm install chartformersbash
npm install chartformers@latest
`
To use a bar chart component import these:
`bash
import { BarChart } from 'chartformers';
import 'chartformers/dist/chartformers.css';
`
Render the chart inside a container with explicit width and height:
`js
`
Example: sortable stacked bar chart
`js
import { StackedBarChart } from "chartformers";
import 'chartformers/dist/chartformers.css';
export default function StackedBarChartExample() {
const companyData = [
{
"label": "TechStream",
"Hardware": 5409,
"Software": 8200,
"Services": 10390,
"Consulting": 21500,
"Maintenance": 7506
},
{
"label": "InnovateX",
"Hardware": 11265,
"Software": 8657,
"Services": 18200,
"Consulting": 9400,
"Maintenance": 5286
},
{
"label": "CloudSphere",
"Hardware": 16087,
"Software": 14200,
"Services": 22400,
"Consulting": 19423,
"Maintenance": 11935
},
{
"label": "DataVantage",
"Hardware": 9912,
"Software": 15900,
"Services": 14674,
"Consulting": 13322,
"Maintenance": 11500
},
{
"label": "CyberCore",
"Hardware": 3488,
"Software": 5520,
"Services": 6685,
"Consulting": 7433,
"Maintenance": 5769
},
{
"label": "AetherSystems",
"Hardware": 6811,
"Software": 8900,
"Services": 8582,
"Consulting": 24100,
"Maintenance": 6700
}
];
return (
);
}
``