rolling and calender toggle
This commit is contained in:
@@ -42,11 +42,11 @@ export default function HistoryChart({
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
rawData = data[activeDataKey]?.[period] || [];
|
rawData = data[activeDataKey]?.[period] || [];
|
||||||
}
|
}
|
||||||
const currentData = [...rawData].reverse();
|
const currentData = rawData;
|
||||||
|
|
||||||
const maxAmount =
|
const maxAmount =
|
||||||
currentData.length > 0
|
currentData.length > 0
|
||||||
? Math.max(...currentData.map((d) => d.amount), 1)
|
? Math.max(...currentData.map((d: { amount: any; }) => d.amount), 1)
|
||||||
: 1;
|
: 1;
|
||||||
|
|
||||||
// ✅ Formatter (₹ + adaptive units)
|
// ✅ Formatter (₹ + adaptive units)
|
||||||
@@ -132,7 +132,7 @@ export default function HistoryChart({
|
|||||||
{/* Chart Area */}
|
{/* Chart Area */}
|
||||||
{currentData.length > 0 ? (
|
{currentData.length > 0 ? (
|
||||||
<Box sx={{ display: "flex", alignItems: "flex-end", height: 200, mt: 4, position: 'relative' }}>
|
<Box sx={{ display: "flex", alignItems: "flex-end", height: 200, mt: 4, position: 'relative' }}>
|
||||||
{currentData.map((point) => {
|
{currentData.map((point: { amount: number; id: string, highlighted: boolean }) => {
|
||||||
const heightPerc = (point.amount / maxAmount) * 100;
|
const heightPerc = (point.amount / maxAmount) * 100;
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
|
|||||||
Reference in New Issue
Block a user