File was renamed from src/pages/left/components/task-charts.jsx |
| | |
| | | import React from 'react'; |
| | | import { useEffect, useState } from 'react'; |
| | | import ReactECharts from 'echarts-for-react'; |
| | | import * as echarts from 'echarts/core'; |
| | | |
| | | const TaskCharts = () => { |
| | | const trafficWay = [ |
| | | const LocCharts = () => { |
| | | const [trafficWay, setTrafficWay] = useState([ |
| | | { |
| | | name: 'HG', |
| | | value: 20, |
| | |
| | | name: 'PG', |
| | | value: 30, |
| | | }, |
| | | ]; |
| | | ]); |
| | | |
| | | useEffect(() => { |
| | | const timer = setInterval(() => { |
| | | // getAgvCharts().then(res => { |
| | | // setApiData(res.reverse().map(item => { |
| | | // return ["AGV" + item.agvNo, "0000" + Number(item.qrcode), item.angle.toFixed(1) + "°", item.height] |
| | | // })) |
| | | // }) |
| | | console.log("aasadsa"); |
| | | }, 1000); |
| | | |
| | | return () => { |
| | | clearInterval(timer); |
| | | } |
| | | }, []); |
| | | |
| | | |
| | | const data = []; |
| | | const color = ['#00ffff', '#00cfff', '#006ced', '#ffe000', '#ffa800', '#ff5b00']; |
| | |
| | | return ( |
| | | <> |
| | | <div> |
| | | <ReactECharts style={{ height: '250px' }} option={option} /> |
| | | <ReactECharts style={{ height: '300px' }} option={option} /> |
| | | </div> |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default TaskCharts; |
| | | export default LocCharts; |