SHARE
TWEET

Untitled

a guest Aug 20th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top