add percentage
This commit is contained in:
@@ -11,6 +11,7 @@ class AbsorbanceGraph extends Component {
|
||||
super(props);
|
||||
this.state = { url: this.props.url, show: this.props.show };
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.drawChart(this.state.url);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 50vh;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 900px) {
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 50vh;
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ class TestAnalyticsPie extends Component {
|
||||
.attr("d", path)
|
||||
.attr("fill", function (d) { return color(d.data.category); })
|
||||
.on('mouseover', (event, d) => {
|
||||
tooltip.text(`${d.data.category}: ${d.data.count}`);
|
||||
tooltip.text(`${d.data.category}: ${d.data.count}, ${100 * d.data.count/data.reduce((a, c) => a + c.count, 0)}%`);
|
||||
return tooltip
|
||||
.style("visibility", "visible")
|
||||
.style("font-size", "0.75em")
|
||||
|
||||
Reference in New Issue
Block a user