You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chart is not displaying api data. i am using this api : https://api.apify.com/v2/key-value-stores/toDWvRj1JpTXiM8FF/records/LATEST?disableRedirect=true
#8
Open
mayanksinha9 opened this issue
May 7, 2020
· 2 comments
mayanksinha9
changed the title
chart is not displaying api data
chart is not displaying api data. i am using this api : https://api.apify.com/v2/key-value-stores/toDWvRj1JpTXiM8FF/records/LATEST?disableRedirect=true
May 7, 2020
import React,{useState,useEffect} from 'react';
import { fetchRegionData } from '../../api';
import {Line,Bar} from 'react-chartjs-2';
import styles from './Chart.module.css';
const Chart=()=>{
const[regionData,setRegionData]=useState([]);
const lineChart=(
(
<Line
data={{
labels: regionData && regionData.map(({region})=>region),
datasets:[{
data: regionData&®ionData.map(({totalInfected})=>totalInfected),
label:'Infected',
borderColor:'#3333ff',
fill:true,
},{
data: regionData&®ionData.map(({recovered})=>recovered),
label:'Recovered',
borderColor:'green',
fill:true,
},{
data: regionData&®ionData.map(({deceased})=>deceased),
label:'Deaths',
borderColor:'red',
fill:true,
}],
}}
/>)
);
}
export default `Chart;```
The text was updated successfully, but these errors were encountered: