diff --git a/apps/planner/app/components/ElevationChart.tsx b/apps/planner/app/components/ElevationChart.tsx index 4ec5f27..fe5c9e6 100644 --- a/apps/planner/app/components/ElevationChart.tsx +++ b/apps/planner/app/components/ElevationChart.tsx @@ -302,6 +302,9 @@ export function ElevationChart({ yjs, onHover, days }: ElevationChartProps) { const grade = dDist > 0 ? ((p.elevation - prev.elevation) / dDist) * 100 : 0; label += ` · ${grade > 0 ? "+" : ""}${grade.toFixed(1)}%`; } + if (colorMode === "surface" && surfaces[highlightIdx]) { + label += ` · ${surfaces[highlightIdx]}`; + } const labelX = hx + 8 > w - 80 ? hx - 8 : hx + 8; ctx.textAlign = hx + 8 > w - 80 ? "right" : "left"; ctx.fillText(label, labelX, PADDING.top + 10); @@ -381,9 +384,15 @@ export function ElevationChart({ yjs, onHover, days }: ElevationChartProps) { {Math.round(Math.max(...points.map(p => p.elevation)))}m )} - {colorMode === "surface" && ( - {t("colorMode.surfaceLegend")} - )} + {colorMode === "surface" && surfaces.length > 0 && (<> + {[...new Set(surfaces)].slice(0, 6).map((s) => ( + + + {s} + + ))} + {[...new Set(surfaces)].length > 6 && +{[...new Set(surfaces)].length - 6}} + )}