import * as echarts from 'echarts'; import { useEffect, useRef } from 'react'; import styles from './index.less'; import './tooltip.css'; const colors = [ '#0D5EF8', '#6AC21D', '#F98E1B', '#ECB934', '#8A34EC', '#FF1493', '#FFFF00', '#DAA520', '#CD853F', '#FF6347', '#808080', '#00BFFF', '#008000', '#00FFFF', '#FFFACD', '#FFA500', '#FF4500', '#800080', '#FF1493', '#000080', ]; const backgroundColor = new echarts.graphic.LinearGradient( 0, 0, 0, 1, [ { offset: 0, color: '#ffffff' }, { offset: 1, color: '#fdfeff' }, ], false, ); function getTooltip(xTitle: string, xValue: number, yTitle: string, yValue: number) { const str = `