From 9de5a48fb4b67e2d7afd61e5c1110d2d7603f6d7 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 20 Oct 2017 16:41:03 +0200 Subject: [PATCH] update size of bar chart --- .../sonar-web/src/main/js/components/charts/bar-chart.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/sonar-web/src/main/js/components/charts/bar-chart.js b/server/sonar-web/src/main/js/components/charts/bar-chart.js index 8e963366f67..1548036d0c6 100644 --- a/server/sonar-web/src/main/js/components/charts/bar-chart.js +++ b/server/sonar-web/src/main/js/components/charts/bar-chart.js @@ -48,6 +48,15 @@ export const BarChart = createReactClass({ }; }, + componentDidUpdate(prevProps) { + if (this.props.width && prevProps.width !== this.props.width) { + this.setState({ width: this.props.width }); + } + if (this.props.height && prevProps.height !== this.props.height) { + this.setState({ height: this.props.height }); + } + }, + getInitialState() { return { width: this.props.width, height: this.props.height }; }, -- 2.39.5