charts-core
v1.1.66
Published
```bash npm i charts-core ```
Keywords
Readme
ChartsCore Library
Installation
npm i charts-coreDon't forget to connect CSS styles to the project. Project styles should be connected later and have priority for convenient override.
import 'charts-core/style.css'Quick start
Line chart
See full Line chart documentation
// to create new instance of chart
const chart = createLineChart('#line-chart', {
chartId: 'some-chart',
data: [
{ date: '2025-02-02T00:00:00.000Z', value: 2800 },
{ date: '2025-02-16T00:00:00.000Z', value: 2970 },
{ date: '2025-03-02T00:00:00.000Z', value: 4120 },
{ date: '2025-03-16T00:00:00.000Z', value: 4260 },
{ date: '2025-04-02T00:00:00.000Z', value: 4120 },
],
config: {
margin: {
right: 50,
},
yAxis: {
customTicks: true,
ticks: [8, 'd'],
},
},
})
// to update it
chart.update({
data: newData,
config: {
theme: 'dark',
},
})
// or destroy
chart.destroy()