hey, so im tryying to implement this solution but i cant seem to figure out how to make the charts larger
here's chart.jsx
useEffect( () => {
const fetchAPI = async () => {
setDailyData(await fetchDailyData());
}
fetchAPI();
}, [])
const barChart = (
confirmed
? (
<Bar
data = {{
labels: ['Infetados','Recuperados','Mortes'],
datasets: [{
label: 'Pessoas',
backgroundColor: [
'rgba(0,0,255,0.5)',
'rgba(0,255,0,0.5)',
'rgba(255,0,0,0.5)',
],
data : [confirmed.value, recovered.value, deaths.value]
}]
}}
options= {{
legend: {display: false},
title: {display: true, text: `Estado atual em ${country}`},
}}
/>
) : null
)
const lineChart = (
dailyData.length
? (
<Line
data={{
labels: dailyData.map(({ date })=> date),
datasets: [ {
data: dailyData.map(({confirmed})=>confirmed),
label: 'Infetados',
borderColor: '#3333ff',
fill: true,
}, {
data: dailyData.map(({deaths}) => deaths),
label: 'Mortos',
borderColor: 'red',
backgroundColor: 'red',
fill: true,
} ],
}}
/>) : null
);
return (
<div className={styles.container} >
{country ? barChart : lineChart}
</div>
)