Skip to content

Commit

Permalink
fix: chart selector aggregation (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt authored Feb 6, 2025
1 parent 767c1a6 commit 2e22761
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export default function AreaChartComponent({
xAxisProps={{
fontSize: "45px",
tickFormatter: (value, index) => {
if (index === 0 || index === formattedData.length - 1) {
if (value === data[0].date || value === data.at(-1).date) {
return formatDate(value, "daily") || "";
}
return "";
Expand Down
31 changes: 23 additions & 8 deletions packages/frontend/components/analytics/DashboardModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,20 @@ function ChartSelectionPanel({
<ChartComponent
id={chart.id}
dataKey={chart.dataKey}
startDate={startDate}
endDate={endDate}
granularity={granularity}
checks={checks}
isCustom={false}
startDate={new Date(chart.startDate || startDate)}
endDate={new Date(chart.endDate || endDate)}
granularity={chart.granularity || granularity}
checks={[
...(Array.isArray(chart.checks)
? chart.checks
: []),
...checks,
]}
color={chart.color}
aggregationMethod={chart.aggregationMethod}
isCustom={chart.isCustom}
primaryDimension={chart.primaryDimension}
secondaryDimension={chart.secondaryDimension}
chart={chart}
/>
</AnalyticsCard>
Expand Down Expand Up @@ -321,11 +330,17 @@ function ChartSelectionPanel({
}
endDate={new Date(chart.endDate || endDate)}
granularity={chart.granularity || granularity}
checks={chart.checks || checks}
checks={[
...(Array.isArray(chart.checks)
? chart.checks
: []),
...checks,
]}
color={chart.color}
aggregationMethod={chart.aggregationMethod}
isCustom={chart.isCustom}
primaryDimension={chart.primaryDimension}
secondaryDimension={chart.secondaryDimension}
aggregationMethod={chart.aggregationMethod}
isCustom={true}
chart={chart}
/>
</AnalyticsCard>
Expand Down

0 comments on commit 2e22761

Please sign in to comment.