Commit 7f0e22e2 by corpglory-dev

Run prettier

parent 568bc1c7
...@@ -56,7 +56,8 @@ export class Piechart extends PureComponent<Props> { ...@@ -56,7 +56,8 @@ export class Piechart extends PureComponent<Props> {
const innerRadius = pieType === PiechartType.PIE ? 0 : radius; const innerRadius = pieType === PiechartType.PIE ? 0 : radius;
d3.select('.piechart-container svg').remove(); d3.select('.piechart-container svg').remove();
const svg = d3.select('.piechart-container') const svg = d3
.select('.piechart-container')
.append('svg') .append('svg')
.attr('width', width) .attr('width', width)
.attr('height', height) .attr('height', height)
...@@ -72,7 +73,8 @@ export class Piechart extends PureComponent<Props> { ...@@ -72,7 +73,8 @@ export class Piechart extends PureComponent<Props> {
const pie = d3.pie(); const pie = d3.pie();
svg.selectAll('path') svg
.selectAll('path')
.data(pie(data)) .data(pie(data))
.enter() .enter()
.append('path') .append('path')
...@@ -91,18 +93,17 @@ export class Piechart extends PureComponent<Props> { ...@@ -91,18 +93,17 @@ export class Piechart extends PureComponent<Props> {
const { height, width } = this.props; const { height, width } = this.props;
return ( return (
<div className='piechart-panel'> <div className="piechart-panel">
<div <div
ref={element => (this.containerElement = element)} ref={element => (this.containerElement = element)}
className='piechart-container' className="piechart-container"
style={{ style={{
height: `${height * 0.9}px`, height: `${height * 0.9}px`,
width: `${Math.min(width, height * 1.3)}px`, width: `${Math.min(width, height * 1.3)}px`,
top: '10px', top: '10px',
margin: 'auto', margin: 'auto',
}} }}
> />
</div>
</div> </div>
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment