import {Modal, Tabs, Switch} from 'antd' import React, {useEffect, useMemo, useState} from 'react'; import "./index.less" import ReactEcharts from "echarts-for-react"; const SyglPage: React.FC = () => { const [echartsOption, setEchartsOption] = useState({}); // @ts-ignore const getOption = () => { const data0 = [1, 1, 1, 1, 1]; const option = { tooltip: { // 在鼠标悬停时触发显示 trigger: 'axis', }, textStyle: { color: "#C9C9C9", }, legend: { type: "scroll", orient: 'vertical', selectedMode: false, right: "40%", top: "15%", textStyle: { color: "#ffffff", fontSize: 14, }, }, grid: { containLabel: true, left: "3%", top: "20%", bottom: "0%", right: "0%", }, xAxis: { type: "category", data: [ "2015", "2016", "2017", "2018", "2019", ], axisLine: { show: true, lineStyle: { color: "#ffffff", opacity: 0.9, }, }, axisTick: { show: false, }, axisLabel: { margin: 20, //刻度标签与轴线之间的距离。 textStyle: { fontFamily: "Microsoft YaHei", color: "#FFF", }, fontSize: 12, fontStyle: "bold" }, }, yAxis: { name: "(万元)", max: 12000, min: 0, nameTextStyle: { color: '#fff', opacity: 0.9 }, type: "value", axisLine: { show: true, lineStyle: { color: "#ffffff", opacity: 0.9, }, }, splitLine: { show: true, lineStyle: { color: 'rgba(255,255,255,0.3)', } }, axisLabel: { textStyle: { fontFamily: "Microsoft YaHei", color: "#FFF", }, fontSize: 12, }, }, series: [ { type: "bar", data: [1796, 717, 2500, 9445, 11345], barMaxWidth: "auto", barWidth: 30, itemStyle: { color: { x: 0, y: 0, x2: 0, y2: 1, type: "linear", global: false, colorStops: [{ offset: 0, color: "#00A9FF", }, { offset: 1, color: "#66DDFF", }, ], }, }, }, // color: [, "#018bc1", "#96e092", "#DE9FB1", "#f06e90", "#f89e92",], {//一蓝底 data: data0, type: "pictorialBar", barMaxWidth: "20", symbol: "diamond", color: "#66DDFF", symbolOffset: ['0', "50%"], symbolSize: [30, 10], zlevel: 2, tooltip: { show: false // 不显示数据2的tooltip } }, {//一蓝盖 data: [1796, 717, 2500, 9445, 11345], type: "pictorialBar", barMaxWidth: "20", symbol: "diamond", symbolPosition: "end", color: "#77C9FF", symbolOffset: ['0', "-45%"], symbolSize: [30, 10], zlevel: 2, tooltip: { show: false // 不显示数据2的tooltip } }, ], markArea: { silent: true, } }; setEchartsOption(option); }; useEffect(() => { getOption(); }, []); return (