rolling and calender toggle
This commit is contained in:
@@ -42,11 +42,11 @@ export default function HistoryChart({
|
||||
// @ts-ignore
|
||||
rawData = data[activeDataKey]?.[period] || [];
|
||||
}
|
||||
const currentData = [...rawData].reverse();
|
||||
const currentData = rawData;
|
||||
|
||||
const maxAmount =
|
||||
currentData.length > 0
|
||||
? Math.max(...currentData.map((d) => d.amount), 1)
|
||||
? Math.max(...currentData.map((d: { amount: any; }) => d.amount), 1)
|
||||
: 1;
|
||||
|
||||
// ✅ Formatter (₹ + adaptive units)
|
||||
@@ -132,7 +132,7 @@ export default function HistoryChart({
|
||||
{/* Chart Area */}
|
||||
{currentData.length > 0 ? (
|
||||
<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;
|
||||
return (
|
||||
<Box
|
||||
|
||||
Reference in New Issue
Block a user