Se agrega ejemplo de MultiAxis Chart.

Se sube a version 1.1.3
Se sube a GitHub 1.1.3
This commit is contained in:
Alejandro Lembke Barrientos 2020-07-10 19:05:18 +00:00
parent af8bee047b
commit 433a810c46
3 changed files with 71 additions and 2 deletions

View File

@ -24,6 +24,75 @@ export default class App extends Component {
<Line />
</div>
<div style={{maxWidth: '600px', marginTop: '25px', margin: 'auto'}}>
<h3 style={{textAlign: 'center'}}>Multi Axis Bar Line Component:</h3>
<Bar config={{
data: {
datasets: [{
label: 'Bar Dataset',
data: [10, 20, 30, 40],
yAxisID: 'A',
backgroundColor: 'rgba(75, 192, 192, 0.2)',
borderColor: 'rgba(75, 192, 192, 1)'
},
{
label: 'Bar Dataset',
data: [10, 20, 30, 40],
yAxisID: 'A',
backgroundColor: 'rgba(75, 192, 192, 0.2)',
borderColor: 'rgba(75, 192, 192, 1)'
},
{
label: 'Bar Dataset',
data: [10, 20, 30, 40],
yAxisID: 'A',
backgroundColor: 'rgba(75, 192, 192, 0.2)',
borderColor: 'rgba(75, 192, 192, 1)'
},
{
// Changes this dataset to become a line
type: 'line',
yAxisID: 'B',
label: 'Line Dataset',
data: [5, 8, 10, 30],
backgroundColor: 'transparent',
borderColor: 'rgba(75, 192, 192, 1)'
},
{
// Changes this dataset to become a line
type: 'line',
yAxisID: 'B',
label: 'Line Dataset',
data: [15, 20, 25, 30],
backgroundColor: 'transparent',
borderColor: 'rgba(75, 192, 192, 1)'
}],
labels: ['January', 'February', 'March', 'April'],
},
options: {
scales: {
yAxes: [{
id: 'A',
type: 'linear',
position: 'left',
/*ticks: {
max: 1,
min: 0
}*/
}, {
id: 'B',
type: 'linear',
position: 'right',
/*ticks: {
max: 1,
min: 0
}*/
}]
}
}
}}/>
</div>
</div>
)
}

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "chartjs-2-react",
"version": "1.1.0",
"version": "1.1.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "chartjs-2-react",
"version": "1.1.2",
"version": "1.1.3",
"description": "Libreria de chart.js para React.js",
"author": "aleleba",
"license": "MIT",