You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

48 lines
1.3 KiB

import React, {useEffect, useState} from 'react'
import { Chart, LineAdvance} from 'bizcharts';
const GraficoPublicacoesDiariasPorComunidade = () => {
const [data, setData] = useState([])
useEffect(() => {
netuno.service({
url: "/services/publicacoes/graficos/comunidades/diaria",
method: "GET",
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
success: (response)=> {
if (response.json) {
setData(response.json)
} else {
fail();
}
},
fail: ()=> {
fail();
}
})
}, [])
const fail = ()=> {
setLoader(false)
notification["error"]({
message: 'Error',
description: 'Data loading error...',
style: {
marginTop: 100,
}
});
};
return(
<Chart padding={[10, 20, 50, 40]} autoFit height={300} data={data}>
<LineAdvance
shape="smooth"
point
area
position="dia*total"
color="comunidade" />
</Chart>
)
}
export default GraficoPublicacoesDiariasPorComunidade