Created
May 3, 2019 01:49
-
-
Save gpDA/c032706bbc1ed8da9d65cfb7d0ff5819 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Doughnut, Line} from 'react-chartjs-2'; | |
| import ReactHeatmap from 'react-heatmap-grid'; | |
| ... | |
| //Doughnut | |
| <Doughnut | |
| data={this.state.piechartData} | |
| width={1000} | |
| height={400} | |
| options={{ | |
| maintainAspectRatio: false, | |
| title:{ | |
| display: true, | |
| text: 'Number of tweets by NYU schools', | |
| fontSize: 15 | |
| }, | |
| legend:{ | |
| display: true, | |
| } | |
| }} | |
| /> | |
| //ReactHeatmap | |
| <ReactHeatmap | |
| xLabels={this.state.heatmapData.xLabels} | |
| yLabels={this.state.heatmapData.yLabels} | |
| yLabelTextAlign={"right"} | |
| xLabelsLocation={"bottom"} | |
| onMouseEnter={() => alert(`hi`)} | |
| cellStyle={(background, value, min, max, data, x, y) => ({ | |
| background: `rgb(87, 6, 140, ${1 - (max - value) / (max - min)})`, | |
| fontSize: "10px", | |
| })} | |
| cellRender={value => value && `${value}`} | |
| data={this.state.heatmapData.data} | |
| /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment