mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 19:05:23 +02:00
feat: exclude 2023 data & improve weekly sales tooltip (add Sell Out €)
This commit is contained in:
@@ -101,7 +101,7 @@ const ComparisonTooltip = ({ active, payload, label }: any) => {
|
|||||||
dataByYear[year] = {};
|
dataByYear[year] = {};
|
||||||
}
|
}
|
||||||
// Use the color from the Sell Out line for consistency for that year block
|
// Use the color from the Sell Out line for consistency for that year block
|
||||||
if (metric.toLowerCase().includes('so')) {
|
if (metric.toLowerCase().includes('sell out')) {
|
||||||
dataByYear[year].sellOut = p.value;
|
dataByYear[year].sellOut = p.value;
|
||||||
dataByYear[year].color = p.stroke || p.color;
|
dataByYear[year].color = p.stroke || p.color;
|
||||||
} else if (metric.toLowerCase().includes('units')) {
|
} else if (metric.toLowerCase().includes('units')) {
|
||||||
|
|||||||
@@ -224,8 +224,8 @@ export const processCSV = (fileOrContent: File | string): Promise<SalesRecord[]>
|
|||||||
const data: SalesRecord[] = results.data.map((row: any, index: number) => {
|
const data: SalesRecord[] = results.data.map((row: any, index: number) => {
|
||||||
return mapRowToRecord(row, index);
|
return mapRowToRecord(row, index);
|
||||||
})
|
})
|
||||||
// Filter: Valid Year AND Allowed Customer
|
// Filter: Valid Year > 2023 (exclude incomplete 2023 data) AND Allowed Customer
|
||||||
.filter((r: SalesRecord) => r.year > 0 && isAllowedCustomer(r.customer));
|
.filter((r: SalesRecord) => r.year > 2023 && isAllowedCustomer(r.customer));
|
||||||
|
|
||||||
resolve(data);
|
resolve(data);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user