Browse Source

Fix responsive style of Pie, close #76

pull/86/head
afc163 9 years ago
parent
commit
e34c58476a
  1. 3
      src/components/Charts/Pie/index.js
  2. 4
      src/components/Charts/Pie/index.less

3
src/components/Charts/Pie/index.js

@ -40,8 +40,7 @@ class Pie extends Component {
window.removeEventListener('resize', this.resize); window.removeEventListener('resize', this.resize);
return; return;
} }
// antd xs size if (this.root.parentNode.clientWidth <= 380) {
if (this.root.parentNode.clientWidth <= 480) {
if (!this.state.legendBlock) { if (!this.state.legendBlock) {
this.setState({ this.setState({
legendBlock: true, legendBlock: true,

4
src/components/Charts/Pie/index.less

@ -6,7 +6,7 @@
position: relative; position: relative;
} }
&.hasLegend .chart { &.hasLegend .chart {
width: ~"calc(100% - 236px)"; width: ~"calc(100% - 240px)";
} }
.legend { .legend {
position: absolute; position: absolute;
@ -86,7 +86,7 @@
margin: 0 0 32px 0; margin: 0 0 32px 0;
} }
.legend { .legend {
position: static; position: relative;
transform: none; transform: none;
} }
} }

Loading…
Cancel
Save