This commit is contained in:
Aifeilong 2023-10-23 10:36:20 +08:00
parent 5f19682bab
commit e0423a6fc3

View File

@ -1,5 +1,3 @@
import { useEffect, useState } from "react";
import { useCesium } from "resium";
import ChartPanel from "@/components/common/ChartPanel"; import ChartPanel from "@/components/common/ChartPanel";
const years = []; const years = [];
@ -29,20 +27,6 @@ const laBrudata = [
]; ];
function CustomChartPanel() { 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 = { const option = {
title: { title: {
// text: "Stacked Line", // text: "Stacked Line",
@ -54,8 +38,8 @@ function CustomChartPanel() {
data: ["拉布拉多海夏季海温(异常值)", "高原夏季气温(异常值)"], data: ["拉布拉多海夏季海温(异常值)", "高原夏季气温(异常值)"],
textStyle: { color: "#04fbfd", cursor: "point", fontSize: 20 }, textStyle: { color: "#04fbfd", cursor: "point", fontSize: 20 },
}, },
animationDuration: years.length * 1000, // animationDuration: years.length * 1000,
animationEasing: "cubicInOut", // animationEasing: "cubicInOut",
grid: { grid: {
left: "3%", left: "3%",
right: "4%", right: "4%",
@ -115,6 +99,9 @@ function CustomChartPanel() {
itemStyle: { itemStyle: {
color: "red", color: "red",
}, },
animationDelay: 5 * 1000,
animationDuration: 30 * 1000,
animationEasing: "cubicInOut",
}, },
{ {
name: "高原夏季气温(异常值)", name: "高原夏季气温(异常值)",
@ -131,6 +118,9 @@ function CustomChartPanel() {
type: "dashed", type: "dashed",
width: 2, width: 2,
}, },
animationDelay: 25 * 1000,
animationDuration: 10 * 1000,
animationEasing: "cubicInOut",
}, },
], ],
}; };