Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. import React from 'react';
  2.  
  3. const Bar = ({ data, barWidth, containerHeight, animationProps: { barHeight, opacity } }) => {
  4. return (
  5. <div>
  6. <div
  7. style={{
  8. marginRight: 10,
  9. backgroundColor: 'teal',
  10. opacity: opacity,
  11. width: barWidth,
  12. height: barHeight,
  13. transform: `translate(0, ${containerHeight - barHeight - 20}px)`
  14. }}
  15. />
  16.  
  17. <label
  18. style={{
  19. color: 'white',
  20. fontSize: 18,
  21. fontWeight: 'bold',
  22. position: 'absolute',
  23. top: `${containerHeight - 50}px`,
  24. marginLeft: 20
  25. }}
  26. >
  27. {barHeight.toFixed(0)}
  28. </label>
  29.  
  30. <label
  31. style={{
  32. fontSize: 18,
  33. fontWeight: 'bold',
  34. position: 'absolute',
  35. top: `${containerHeight}px`,
  36. marginLeft: 10
  37. }}
  38. >
  39. {data.name}
  40. </label>
  41. </div>
  42. );
  43. };
  44.  
  45. export default Bar;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement