fixed compare display
This commit is contained in:
@@ -6,6 +6,7 @@ export interface ChartDataPoint {
|
||||
amount: number;
|
||||
compareAmount?: number;
|
||||
count?: number;
|
||||
compareLabel?: string;
|
||||
highlighted?: boolean;
|
||||
}
|
||||
|
||||
@@ -203,9 +204,17 @@ export default function HistoryChart({
|
||||
}}
|
||||
>
|
||||
{/* Values */}
|
||||
<Typography variant="caption" sx={{ mb: 1, fontSize: "0.65rem" }}>
|
||||
{formatAmount(point.amount)}
|
||||
</Typography>
|
||||
<Box sx={{ mb: 1, textAlign: "center" }}>
|
||||
{comparison && point.compareAmount ? (
|
||||
<Typography variant="caption" sx={{ fontSize: "0.6rem", color: "text.secondary" }}>
|
||||
{formatAmount(point.compareAmount)}
|
||||
</Typography>
|
||||
) : null}
|
||||
|
||||
<Typography variant="caption" sx={{ fontSize: "0.65rem" }}>
|
||||
{formatAmount(point.amount)}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
{/* Bars */}
|
||||
<Box
|
||||
@@ -240,18 +249,25 @@ export default function HistoryChart({
|
||||
</Box>
|
||||
|
||||
{/* Label */}
|
||||
<Typography
|
||||
variant="caption"
|
||||
color="text.secondary"
|
||||
sx={{
|
||||
mt: 1,
|
||||
fontSize: "0.7rem",
|
||||
textAlign: "center",
|
||||
whiteSpace: "pre-line"
|
||||
}}
|
||||
>
|
||||
{point.id}
|
||||
</Typography>
|
||||
<Box sx={{ mt: 1, textAlign: "center" }}>
|
||||
{comparison && point.compareLabel && (
|
||||
<Typography
|
||||
variant="caption"
|
||||
color="text.secondary"
|
||||
sx={{ fontSize: "0.6rem", display: "block" }}
|
||||
>
|
||||
{point.compareLabel}
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
<Typography
|
||||
variant="caption"
|
||||
color="text.secondary"
|
||||
sx={{ fontSize: "0.7rem", display: "block" }}
|
||||
>
|
||||
{point.id}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user