3 changed files with 137 additions and 140 deletions
			
			
		@ -0,0 +1,91 @@ | 
				
			|||
import React, { useEffect, useRef } from 'react'; | 
				
			|||
import './style.less' | 
				
			|||
import * as echarts from 'echarts'; | 
				
			|||
export default function LeftItem() { | 
				
			|||
    const seasonChartRef = useRef(null); | 
				
			|||
    useEffect(() => { | 
				
			|||
        let chartInstance = echarts.init(seasonChartRef.current); | 
				
			|||
        const seasonOption = { | 
				
			|||
          title: [ | 
				
			|||
            { | 
				
			|||
              text: "已处理", | 
				
			|||
              x: "center", | 
				
			|||
              top: "55%", | 
				
			|||
              textStyle: { | 
				
			|||
                color: "#E9F7FF", | 
				
			|||
                fontSize: 14, | 
				
			|||
              }, | 
				
			|||
            }, | 
				
			|||
            { | 
				
			|||
              text: "2333", | 
				
			|||
              x: "center", | 
				
			|||
              y: "35%", | 
				
			|||
              textStyle: { | 
				
			|||
                fontSize: "30", | 
				
			|||
                color: "#FFFFFF", | 
				
			|||
                fontFamily: "YouSheBiaoTiHei", | 
				
			|||
              }, | 
				
			|||
            }, | 
				
			|||
          ], | 
				
			|||
          polar: { | 
				
			|||
            radius: ["78%", "86%"], | 
				
			|||
            center: ["50%", "50%"], | 
				
			|||
          }, | 
				
			|||
          angleAxis: { | 
				
			|||
            max: 100, | 
				
			|||
            show: false, | 
				
			|||
          }, | 
				
			|||
          radiusAxis: { | 
				
			|||
            type: "category", | 
				
			|||
            show: true, | 
				
			|||
            axisLabel: { | 
				
			|||
              show: false, | 
				
			|||
            }, | 
				
			|||
            axisLine: { | 
				
			|||
              show: false, | 
				
			|||
            }, | 
				
			|||
            axisTick: { | 
				
			|||
              show: false, | 
				
			|||
            }, | 
				
			|||
          }, | 
				
			|||
          series: [ | 
				
			|||
            { | 
				
			|||
              name: "", | 
				
			|||
              type: "bar", | 
				
			|||
              roundCap: true, | 
				
			|||
              barWidth: 30, | 
				
			|||
              showBackground: true, | 
				
			|||
              data: [40], | 
				
			|||
              coordinateSystem: "polar", | 
				
			|||
              itemStyle: { | 
				
			|||
                normal: { | 
				
			|||
                  color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [ | 
				
			|||
                    { | 
				
			|||
                      offset: 0, | 
				
			|||
                      color: "#AAC8FF", | 
				
			|||
                    }, | 
				
			|||
                    { | 
				
			|||
                      offset: 1, | 
				
			|||
                      color: "#0041BB", | 
				
			|||
                    }, | 
				
			|||
                  ]), | 
				
			|||
                }, | 
				
			|||
              }, | 
				
			|||
            }, | 
				
			|||
          ], | 
				
			|||
        }; | 
				
			|||
        chartInstance.setOption(seasonOption); | 
				
			|||
     | 
				
			|||
      }, []) | 
				
			|||
  return ( | 
				
			|||
    <div className='guanli-left-item'> | 
				
			|||
        <div className='guanli-left-item-left'> | 
				
			|||
            <span>莲塘镇</span> | 
				
			|||
            <div>244 <span>个</span></div> | 
				
			|||
        </div> | 
				
			|||
        <div className='guanli-left-item-right'> | 
				
			|||
            <div ref={seasonChartRef} style={{ height: "100%", width: "100%" }}></div> | 
				
			|||
        </div> | 
				
			|||
    </div> | 
				
			|||
  ) | 
				
			|||
} | 
				
			|||
					Loading…
					
					
				
		Reference in new issue