From e3ea4f839ba64d2a73310e6f631e4b1643a8cb94 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Sat, 12 Jun 2021 02:10:38 -0400 Subject: [PATCH] PieChart: Fixes legend dimension limits (#35563) (#35584) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * PieChart: Fixes legend size limits * Fixing table legend * remove legend (cherry picked from commit a328afd63128355c7679c94f414e0d5ed14172e5) Co-authored-by: Torkel Ödegaard --- packages/grafana-ui/src/components/TimeSeries/TimeSeries.tsx | 2 +- packages/grafana-ui/src/components/VizLayout/VizLayout.tsx | 2 +- packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/grafana-ui/src/components/TimeSeries/TimeSeries.tsx b/packages/grafana-ui/src/components/TimeSeries/TimeSeries.tsx index ead1711993f..9285f6db117 100644 --- a/packages/grafana-ui/src/components/TimeSeries/TimeSeries.tsx +++ b/packages/grafana-ui/src/components/TimeSeries/TimeSeries.tsx @@ -29,7 +29,7 @@ export class UnthemedTimeSeries extends React.Component { return null; } - return ; + return ; }; render() { diff --git a/packages/grafana-ui/src/components/VizLayout/VizLayout.tsx b/packages/grafana-ui/src/components/VizLayout/VizLayout.tsx index 1ef59b16c23..ce5aa009179 100644 --- a/packages/grafana-ui/src/components/VizLayout/VizLayout.tsx +++ b/packages/grafana-ui/src/components/VizLayout/VizLayout.tsx @@ -35,7 +35,7 @@ export const VizLayout: VizLayoutComponentType = ({ width, height, legend, child return
{children(width, height)}
; } - const { placement, maxHeight, maxWidth } = legend.props; + const { placement, maxHeight = '35%', maxWidth = '60%' } = legend.props; let size: VizSize | null = null; diff --git a/packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx b/packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx index 8e3ea829c12..e79955f01ab 100644 --- a/packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx +++ b/packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx @@ -97,7 +97,6 @@ export const VizLegendTable = ({ const getStyles = (theme: GrafanaTheme) => ({ table: css` width: 100%; - margin-left: ${theme.spacing.sm}; th:first-child { width: 100%; }