From e0423a6fc3ad173c337eb686592a03a09bba177a Mon Sep 17 00:00:00 2001 From: Aifeilong <2993607249@qq.com> Date: Mon, 23 Oct 2023 10:36:20 +0800 Subject: [PATCH] fix --- .../domain/One/CustomChartPanel.jsx | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/components/domain/One/CustomChartPanel.jsx b/src/components/domain/One/CustomChartPanel.jsx index 54478ec..eb806cf 100644 --- a/src/components/domain/One/CustomChartPanel.jsx +++ b/src/components/domain/One/CustomChartPanel.jsx @@ -1,5 +1,3 @@ -import { useEffect, useState } from "react"; -import { useCesium } from "resium"; import ChartPanel from "@/components/common/ChartPanel"; const years = []; @@ -29,20 +27,6 @@ const laBrudata = [ ]; function CustomChartPanel() { - const { viewer } = useCesium(); - const [isHighlight, setIsHighlight] = useState(false); - - const { shouldAnimate } = viewer.clock; - - useEffect(() => { - if (shouldAnimate) { - setIsHighlight(true); - setTimeout(() => { - setIsHighlight(false); - }, 3000); - } - }, [shouldAnimate]); - const option = { title: { // text: "Stacked Line", @@ -54,8 +38,8 @@ function CustomChartPanel() { data: ["拉布拉多海夏季海温(异常值)", "高原夏季气温(异常值)"], textStyle: { color: "#04fbfd", cursor: "point", fontSize: 20 }, }, - animationDuration: years.length * 1000, - animationEasing: "cubicInOut", + // animationDuration: years.length * 1000, + // animationEasing: "cubicInOut", grid: { left: "3%", right: "4%", @@ -115,6 +99,9 @@ function CustomChartPanel() { itemStyle: { color: "red", }, + animationDelay: 5 * 1000, + animationDuration: 30 * 1000, + animationEasing: "cubicInOut", }, { name: "高原夏季气温(异常值)", @@ -131,6 +118,9 @@ function CustomChartPanel() { type: "dashed", width: 2, }, + animationDelay: 25 * 1000, + animationDuration: 10 * 1000, + animationEasing: "cubicInOut", }, ], };