From f515d2efac72b8d930c2c5bdb1bd383bd44151da Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Fri, 26 May 2023 10:07:09 +0200 Subject: [PATCH] [Timeseries] Place legend to bottom when on { * @beta */ export const VizLayout: VizLayoutComponentType = ({ width, height, legend, children }) => { + const theme = useTheme2(); const styles = useStyles2(getVizStyles); const containerStyle: CSSProperties = { display: 'flex', @@ -50,7 +51,11 @@ export const VizLayout: VizLayoutComponentType = ({ width, height, legend, child ); } - const { placement, maxHeight = '35%', maxWidth = '60%' } = legend.props; + let { placement, maxHeight = '35%', maxWidth = '60%' } = legend.props; + + if (document.body.clientWidth < theme.breakpoints.values.lg) { + placement = 'bottom'; + } let size: VizSize | null = null;