-
-
-
+
+
+
1月
@@ -553,78 +582,107 @@ onMounted(() => {
height: 300px;
}
-/* 日活用户趋势图 */
-.mock-chart {
+/* 日活用户趋势图 - SVG曲线图 */
+.line-chart {
position: relative;
width: 100%;
height: 200px;
margin-bottom: 20px;
+ background: white;
+ border-radius: 8px;
+ overflow: hidden;
}
-.chart-line {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: linear-gradient(
- 45deg,
- transparent 0%,
- transparent 15%,
- #3b82f6 15%,
- #3b82f6 25%,
- transparent 25%,
- transparent 35%,
- #3b82f6 35%,
- #3b82f6 45%,
- transparent 45%,
- transparent 55%,
- #3b82f6 55%,
- #3b82f6 65%,
- transparent 65%,
- transparent 75%,
- #3b82f6 75%,
- #3b82f6 85%,
- transparent 85%
- );
- opacity: 0.3;
-}
-
-.chart-points {
- position: absolute;
- top: 0;
- left: 0;
+.chart-svg {
width: 100%;
height: 100%;
}
-.chart-point {
- position: absolute;
- width: 6px;
- height: 6px;
- background: #3b82f6;
- border-radius: 50%;
- border: 2px solid white;
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+.chart-line-path {
+ stroke-dasharray: 1000;
+ stroke-dashoffset: 1000;
+ animation: drawLine 2s ease-in-out forwards;
}
-.chart-tooltip {
- position: absolute;
- background: #1e293b;
- color: white;
- padding: 8px 12px;
- border-radius: 6px;
- font-size: 12px;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
+.chart-dot {
+ opacity: 0;
+ animation: fadeInDots 0.5s ease-in-out forwards;
+ animation-delay: 1.5s;
}
-.tooltip-value {
- font-weight: 600;
- margin-bottom: 2px;
+.highlight-dot {
+ opacity: 0;
+ animation: highlightDot 0.5s ease-in-out forwards;
+ animation-delay: 2s;
}
-.tooltip-date {
- opacity: 0.8;
+.highlight-ring {
+ opacity: 0;
+ animation: highlightRing 1s ease-in-out infinite;
+ animation-delay: 2s;
+}
+
+.tooltip-group {
+ opacity: 0;
+ animation: fadeInTooltip 0.5s ease-in-out forwards;
+ animation-delay: 2.5s;
+}
+
+.tooltip-bg {
+ filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
+}
+
+.tooltip-arrow {
+ filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
+}
+
+/* 动画效果 */
+@keyframes drawLine {
+ to {
+ stroke-dashoffset: 0;
+ }
+}
+
+@keyframes fadeInDots {
+ to {
+ opacity: 1;
+ }
+}
+
+@keyframes highlightDot {
+ to {
+ opacity: 1;
+ }
+}
+
+@keyframes highlightRing {
+ 0%, 100% {
+ opacity: 0.2;
+ transform: scale(1);
+ }
+ 50% {
+ opacity: 0.4;
+ transform: scale(1.2);
+ }
+}
+
+@keyframes fadeInTooltip {
+ to {
+ opacity: 1;
+ }
+}
+
+/* 悬停效果 */
+.chart-dot:hover {
+ r: 6;
+ fill: #2563eb;
+ transition: all 0.2s ease;
+}
+
+.highlight-dot:hover {
+ r: 8;
+ fill: #2563eb;
+ transition: all 0.2s ease;
}
.chart-x-axis {