charts-core 1.1.45 → 1.1.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -57
- package/dist/charts-core.js +2153 -2037
- package/dist/charts-core.js.map +1 -1
- package/dist/charts-core.umd.cjs +3 -3
- package/dist/charts-core.umd.cjs.map +1 -1
- package/package.json +48 -48
package/README.md
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
# ChartsCore Library
|
|
2
|
-
|
|
3
|
-
## Installation
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
npm i charts-core
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
Don't forget to connect CSS styles to the project. Project styles should be connected later and have priority for convenient override.
|
|
10
|
-
|
|
11
|
-
```js
|
|
12
|
-
import 'charts-core/style.css'
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Quick start
|
|
16
|
-
|
|
17
|
-
### Line chart
|
|
18
|
-
|
|
19
|
-
[See full Line chart documentation](./src/docs/line-chart.md)
|
|
20
|
-
|
|
21
|
-
```js
|
|
22
|
-
// to create new instance of chart
|
|
23
|
-
const chart = createLineChart('#line-chart', {
|
|
24
|
-
chartId: 'some-chart',
|
|
25
|
-
data: [
|
|
26
|
-
{ date: '2025-02-02T00:00:00.000Z', value: 2800 },
|
|
27
|
-
{ date: '2025-02-16T00:00:00.000Z', value: 2970 },
|
|
28
|
-
{ date: '2025-03-02T00:00:00.000Z', value: 4120 },
|
|
29
|
-
{ date: '2025-03-16T00:00:00.000Z', value: 4260 },
|
|
30
|
-
{ date: '2025-04-02T00:00:00.000Z', value: 4120 },
|
|
31
|
-
],
|
|
32
|
-
config: {
|
|
33
|
-
margin: {
|
|
34
|
-
right: 50,
|
|
35
|
-
},
|
|
36
|
-
yAxis: {
|
|
37
|
-
customTicks: true,
|
|
38
|
-
ticks: [8, 'd'],
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
// to update it
|
|
44
|
-
chart.update({
|
|
45
|
-
data: newData,
|
|
46
|
-
config: {
|
|
47
|
-
theme: 'dark',
|
|
48
|
-
},
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
// or destroy
|
|
52
|
-
chart.destroy()
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Candlestick chart
|
|
56
|
-
|
|
57
|
-
[See full Candlestick chart documentation](./src/docs/candlestick.md)
|
|
1
|
+
# ChartsCore Library
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i charts-core
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Don't forget to connect CSS styles to the project. Project styles should be connected later and have priority for convenient override.
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import 'charts-core/style.css'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
### Line chart
|
|
18
|
+
|
|
19
|
+
[See full Line chart documentation](./src/docs/line-chart.md)
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
// to create new instance of chart
|
|
23
|
+
const chart = createLineChart('#line-chart', {
|
|
24
|
+
chartId: 'some-chart',
|
|
25
|
+
data: [
|
|
26
|
+
{ date: '2025-02-02T00:00:00.000Z', value: 2800 },
|
|
27
|
+
{ date: '2025-02-16T00:00:00.000Z', value: 2970 },
|
|
28
|
+
{ date: '2025-03-02T00:00:00.000Z', value: 4120 },
|
|
29
|
+
{ date: '2025-03-16T00:00:00.000Z', value: 4260 },
|
|
30
|
+
{ date: '2025-04-02T00:00:00.000Z', value: 4120 },
|
|
31
|
+
],
|
|
32
|
+
config: {
|
|
33
|
+
margin: {
|
|
34
|
+
right: 50,
|
|
35
|
+
},
|
|
36
|
+
yAxis: {
|
|
37
|
+
customTicks: true,
|
|
38
|
+
ticks: [8, 'd'],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
// to update it
|
|
44
|
+
chart.update({
|
|
45
|
+
data: newData,
|
|
46
|
+
config: {
|
|
47
|
+
theme: 'dark',
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
// or destroy
|
|
52
|
+
chart.destroy()
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Candlestick chart
|
|
56
|
+
|
|
57
|
+
[See full Candlestick chart documentation](./src/docs/candlestick.md)
|