rusackas commented on code in PR #41350:
URL: https://github.com/apache/superset/pull/41350#discussion_r3477094518
##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts:
##########
@@ -580,13 +580,19 @@ export default function transformProps(
if (maxSecondary === undefined) maxSecondary = 1;
}
+ // A dashboard-level time grain override (e.g. via a filter or the temporal
+ // range control) is delivered in extraFormData and should take precedence
+ // over the chart's own time grain when formatting temporal axes/tooltips.
+ const resolvedTimeGrain =
+ formData.extraFormData?.time_grain_sqla ?? timeGrainSqla;
+
const tooltipFormatter =
xAxisDataType === GenericDataType.Temporal
- ? getTooltipTimeFormatter(tooltipTimeFormat)
+ ? getTooltipTimeFormatter(tooltipTimeFormat, resolvedTimeGrain)
: String;
const xAxisFormatter =
xAxisDataType === GenericDataType.Temporal
- ? getXAxisFormatter(xAxisTimeFormat, timeGrainSqla)
+ ? getXAxisFormatter(xAxisTimeFormat, resolvedTimeGrain)
: String;
Review Comment:
Good catch — `showMaxLabel` was still keying off `timeGrainSqla` while the
rest of the axis logic uses `resolvedTimeGrain`. Switched it to the resolved
grain so dashboard overrides drive the dedup/overlap handling too.
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -724,13 +724,19 @@ export default function transformProps(
}
}
+ // A dashboard-level time grain override (e.g. via a filter or the temporal
+ // range control) is delivered in extraFormData and should take precedence
+ // over the chart's own time grain when formatting temporal axes/tooltips.
+ const resolvedTimeGrain =
Review Comment:
Same fix applied here — `showMaxLabel` now uses `resolvedTimeGrain`, so the
last-label/dedup path honors a dashboard grain override consistently with the
tooltip and interval logic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]