diff --git a/src/components/HistoryChart.tsx b/src/components/HistoryChart.tsx
index d86ba38..5540d9e 100644
--- a/src/components/HistoryChart.tsx
+++ b/src/components/HistoryChart.tsx
@@ -103,7 +103,12 @@ export default function HistoryChart({
: 1;
const [startIndex, setStartIndex] = React.useState(0);
- const visibleCount = activeDataKey == 'daily' ? 7 : 6;
+ const visibleCountDataTabMapping = {
+ daily: 7,
+ weekly: 6,
+ monthly: 4,
+ }
+ const visibleCount = visibleCountDataTabMapping[activeDataKey];
const total = currentData.length;
// clamp startIndex so we always show full 5 (when possible)
@@ -163,29 +168,60 @@ export default function HistoryChart({
))}
- v && onPeriodChange(v)}
- size="small"
- sx={{ mb: 2 }}
+
- Rolling
-
- Calendar
-
-
+ {/* Rolling / Calendar */}
+ v && onPeriodChange(v)}
+ size="small"
+ >
+ Rolling
+
+ Calendar
+
+
- setComparison(v === "on")}
- size="small"
- sx={{ mb: 2 }}
- >
- Single
- Compare
-
+ {/* Compare toggle */}
+ setComparison(!comparison)}
+ size="small"
+ sx={{
+ textTransform: "none",
+ borderRadius: 2,
+ px: 2,
+
+ // OFF
+ color: "text.secondary",
+ border: "1px solid",
+ borderColor: "divider",
+
+ // ON
+ "&.Mui-selected": {
+ color: "white",
+ bgcolor: "success.main",
+ borderColor: "success.main"
+ },
+ "&.Mui-selected:hover": {
+ bgcolor: "success.dark"
+ }
+ }}
+ >
+ Compare
+
+
{currentData.length > 0 ? (