Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import React from 'react';
  2. import {HorizontalBar, Radar, Polar,Pie, Doughnut} from 'react-chartjs-2';
  3.  
  4. const Chart = (props) =>{
  5.  
  6. const defaultProps = {
  7. displayTitle:true,
  8. displayLegend: false,
  9. }
  10. return (
  11. <div className="chart">
  12. <HorizontalBar
  13. data={props.chartData}
  14. options={{
  15. maintainAspectRatio:true,
  16. title:{
  17. display:defaultProps.displayTitle,
  18. text: "Population of some cool cities",
  19. fontSize:25
  20. },
  21. legend:{
  22. display:defaultProps.displayLegend,
  23. }
  24. }}
  25. />
  26. </div>
  27. )
  28. }
  29.  
  30. export default Chart;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement