Skip to content

Commit 4348128

Browse files
committed
docs: Readme and Changelog update
1 parent ce3e8f7 commit 4348128

File tree

2 files changed

+51
-55
lines changed

2 files changed

+51
-55
lines changed

CHANGELOG.md

Lines changed: 28 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
### [@coreui/react-chartjs](https://coreui.io/) changelog
22

3+
##### `1.0.0-alpha.4`
4+
BREAKING CHANGE:
5+
- `<CCharts>` component has been deprecated and will be removed in v1.0.0
6+
- use `<CChart type="...">` instead
7+
or one of following types:
8+
`<CChartBar>`
9+
`<CChartHorizontalBar>`
10+
`<CChartLine>`
11+
`<CChartDoughnut>`
12+
`<CChartRadar>`
13+
`<CChartPie>`
14+
`<CChartPolarArea>`
15+
16+
sample import:
17+
```jsx
18+
import {
19+
CChart,
20+
CChartBar,
21+
CChartHorizontalBar,
22+
CChartLine,
23+
CChartDoughnut,
24+
CChartRadar,
25+
CChartPie,
26+
CChartPolarArea
27+
} from '@coreui/react-chartjs';
28+
```
29+
30+
331
##### `1.0.0-alpha.0`
432
- initial version
533

@@ -9,56 +37,3 @@ npm install @coreui/react
937
npm install @coreui/react-chartjs
1038
```
1139

12-
import:
13-
```jsx
14-
import { CCharts } from '@coreui/react-chartjs';
15-
```
16-
17-
usage:
18-
```jsx
19-
...
20-
class CoreUICharts extends Component {
21-
...
22-
render() {
23-
return (
24-
<CCharts
25-
type="radar"
26-
datasets={[
27-
{
28-
label: '2019',
29-
backgroundColor: 'rgba(179,181,198,0.2)',
30-
borderColor: 'rgba(179,181,198,1)',
31-
pointBackgroundColor: 'rgba(179,181,198,1)',
32-
pointBorderColor: '#fff',
33-
pointHoverBackgroundColor: '#fff',
34-
pointHoverBorderColor: 'rgba(179,181,198,1)',
35-
tooltipLabelColor: 'rgba(179,181,198,1)',
36-
data: [65, 59, 90, 81, 56, 55, 40]
37-
},
38-
{
39-
label: '2020',
40-
backgroundColor: 'rgba(255,99,132,0.2)',
41-
borderColor: 'rgba(255,99,132,1)',
42-
pointBackgroundColor: 'rgba(255,99,132,1)',
43-
pointBorderColor: '#fff',
44-
pointHoverBackgroundColor: '#fff',
45-
pointHoverBorderColor: 'rgba(255,99,132,1)',
46-
tooltipLabelColor: 'rgba(255,99,132,1)',
47-
data: [28, 48, 40, 19, 96, 27, 100]
48-
}
49-
]}
50-
options={{
51-
aspectRatio: 1.5,
52-
tooltips: {
53-
enabled: true
54-
}
55-
}}
56-
labels={[
57-
'Eating', 'Drinking', 'Sleeping', 'Designing',
58-
'Coding', 'Cycling', 'Running'
59-
]}
60-
/>
61-
)
62-
}
63-
...
64-
```

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,29 @@ npm install @coreui/react-chartjs
1414

1515
##### import:
1616
```jsx
17-
import { CCharts } from '@coreui/react-chartjs';
17+
import { CChart } from '@coreui/react-chartjs';
1818
```
19+
or
20+
```js
21+
import {
22+
CChart,
23+
CChartBar,
24+
CChartHorizontalBar,
25+
CChartLine,
26+
CChartDoughnut,
27+
CChartRadar,
28+
CChartPie,
29+
CChartPolarArea,
30+
} from '@coreui/react-chartjs'
31+
```
32+
33+
props:
34+
- `innerRef` object | func | string
35+
- `datasets` array
36+
- `labels` array | string
37+
- `options` object
38+
- `plugins` array
39+
- `type` string: `bar` | `horizontalBar` | `line` | `doughnut` | `radar` | `pie` | `polarArea`
1940

2041
##### usage:
2142
```jsx
@@ -24,7 +45,7 @@ class CoreUICharts extends Component {
2445
...
2546
render() {
2647
return (
27-
<CCharts
48+
<CChart
2849
type="radar"
2950
datasets={[
3051
{

0 commit comments

Comments
 (0)