You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "CoderSxy (via GitHub)" <gi...@apache.org> on 2025/10/13 07:24:55 UTC
Re: [D] Adaptive layout on mobile devices for Superset Dashboard [superset]
GitHub user CoderSxy added a comment to the discussion: Adaptive layout on mobile devices for Superset Dashboard
try this
` @media screen and (max-width: 700px) {
.grid-container {
margin-left: 10px !important;
margin-right: 10px !important;
}
.grid-row {
flex-wrap: wrap;
.dragdroppable-column {
width: 100%;
margin-right: 0 !important;
margin-bottom: 20px;
&:last-child {
margin-bottom: 0;
}
.resizable-container {
width: 100% !important;
max-width: 100% !important;
}
}
}
}`
And also need to be in the src/dashboard/components/gridComponents/ChartHolder TSX added a judgment
`if (isFullSize) {
chartWidth = window.innerWidth - CHART_MARGIN;
chartHeight = window.innerHeight - CHART_MARGIN;
} else if (
window.innerWidth < 700 &&
document.querySelector('.slice_container')?.clientWidth > 100
) {
chartWidth = document.querySelector('.slice_container')?.clientWidth;
chartHeight = Math.floor(
component.meta.height * GRID_BASE_UNIT - CHART_MARGIN,
);
} else {`
GitHub link: https://github.com/apache/superset/discussions/20734#discussioncomment-14662652
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org