Label.js (503B)
1 import React from 'react'; 2 3 const Label = props => { 4 const x = props.x + props.dx; 5 const y = props.y + props.dy; 6 return ( 7 <text 8 style={{ 9 fontWeight: 'bold', 10 fontSize: '2px', 11 transformOrigin: `${x}px ${y}px`, 12 transform: `rotate(${props.dataEntry.startAngle + 187}deg)`, 13 }} 14 x={x} 15 y={y} 16 > 17 {props.children} 18 </text> 19 ); 20 } 21 22 export default Label;