From e34c58476af542de5bb4eb6f7ba1ee8707677886 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 2 Nov 2017 17:01:46 +0800 Subject: [PATCH] Fix responsive style of Pie, close #76 --- src/components/Charts/Pie/index.js | 3 +-- src/components/Charts/Pie/index.less | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/Charts/Pie/index.js b/src/components/Charts/Pie/index.js index febc57c7..770a94ad 100644 --- a/src/components/Charts/Pie/index.js +++ b/src/components/Charts/Pie/index.js @@ -40,8 +40,7 @@ class Pie extends Component { window.removeEventListener('resize', this.resize); return; } - // antd xs size - if (this.root.parentNode.clientWidth <= 480) { + if (this.root.parentNode.clientWidth <= 380) { if (!this.state.legendBlock) { this.setState({ legendBlock: true, diff --git a/src/components/Charts/Pie/index.less b/src/components/Charts/Pie/index.less index 0ad561db..176566ea 100644 --- a/src/components/Charts/Pie/index.less +++ b/src/components/Charts/Pie/index.less @@ -6,7 +6,7 @@ position: relative; } &.hasLegend .chart { - width: ~"calc(100% - 236px)"; + width: ~"calc(100% - 240px)"; } .legend { position: absolute; @@ -86,7 +86,7 @@ margin: 0 0 32px 0; } .legend { - position: static; + position: relative; transform: none; } } -- GitLab