PieChart: Fixes legend dimension limits (#35563) (#35584)

* PieChart: Fixes legend size limits

* Fixing table legend

* remove legend

(cherry picked from commit a328afd631)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
This commit is contained in:
Grot (@grafanabot)
2021-06-12 08:10:38 +02:00
committed by GitHub
co-authored by Torkel Ödegaard
parent be3032c4e8
commit e3ea4f839b
3 changed files with 2 additions and 3 deletions
@@ -29,7 +29,7 @@ export class UnthemedTimeSeries extends React.Component<TimeSeriesProps> {
return null;
}
return <PlotLegend data={frames} config={config} maxHeight="35%" maxWidth="60%" {...legend} />;
return <PlotLegend data={frames} config={config} {...legend} />;
};
render() {
@@ -35,7 +35,7 @@ export const VizLayout: VizLayoutComponentType = ({ width, height, legend, child
return <div style={containerStyle}>{children(width, height)}</div>;
}
const { placement, maxHeight, maxWidth } = legend.props;
const { placement, maxHeight = '35%', maxWidth = '60%' } = legend.props;
let size: VizSize | null = null;
@@ -97,7 +97,6 @@ export const VizLegendTable = <T extends unknown>({
const getStyles = (theme: GrafanaTheme) => ({
table: css`
width: 100%;
margin-left: ${theme.spacing.sm};
th:first-child {
width: 100%;
}