Lightweight JavaScript library that wraps Chart.js to render any JSON data source into interactive, responsive charts with minimal configuration.
Include after Chart.js in your project or WordPress theme:
<scriptsrc="https://cdn.jsdelivr.net/npm/chart.js"></script><scriptsrc="chartcrafter.js"></script>newChartCrafter('#my-chart',{source: 'https://example.com/data.json',type: 'bar',height: 400,title: 'Monthly Sales'});| Option | Type | Default | Description |
|---|---|---|---|
source | string | null | URL of your JSON data (required) |
type | string | 'bar' | Chart type: bar, line, pie, doughnut, radar, polarArea |
height | number | 400 | Chart height in pixels |
title | string | '' | Chart title |
responsive | boolean | true | Make chart responsive |
Simple format (single series):
{
"labels": ["Jan", "Feb", "Mar"],
"data": [120, 190, 150]
}Multi-series format:
{
"labels": ["Jan", "Feb", "Mar"],
"datasets": [
{ "label": "Revenue", "data": [120, 190, 150] },
{ "label": "Costs", "data": [80, 100, 90] }
]
}npm install
npm testGPL v2 or later.
Part of the Crafter plugin family by TableCrafter.