diff --git a/app/components/chart-shared.tsx b/app/components/chart-shared.tsx index cd55e2123..94946606b 100644 --- a/app/components/chart-shared.tsx +++ b/app/components/chart-shared.tsx @@ -137,6 +137,7 @@ export const ChartMoreButton = ({ chartKey: string; chartWrapperNode?: HTMLElement | null; }) => { + const locale = useLocale(); const [state, dispatch] = useConfiguratorState(hasChartConfigs); const [anchor, setAnchor] = useState(null); const handleClose = useEventCallback(() => setAnchor(null)); @@ -153,6 +154,12 @@ export const ChartMoreButton = ({ state.layout.type === "dashboard" && chartConfig.chartType === "table"; + const screenshotName = useMemo(() => { + const date = timeUnitToFormatter.Day(new Date()); + const label = chartConfig.meta.title[locale] || chartConfig.chartType; + return `${date}_${label}`; + }, [chartConfig.meta.title, chartConfig.chartType, locale]); + return disableButton ? null : ( <> @@ -218,7 +225,7 @@ export const ChartMoreButton = ({ />