Просмотр исходного кода

Fix responsive style of Pie, close #76

afc163 8 лет назад
Родитель
Сommit
e34c58476a
2 измененных файлов с 3 добавлено и 4 удалено
  1. 1 2
      src/components/Charts/Pie/index.js
  2. 2 2
      src/components/Charts/Pie/index.less

+ 1 - 2
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,

+ 2 - 2
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;
   }
 }