recharts#Text JavaScript Examples
The following examples show how to use
recharts#Text.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CasesOverTime.js From SaraAlert with Apache License 2.0 | 6 votes |
render() {
return (
<React.Fragment>
<Card className="card-square">
<Card.Header as="h5">Total Assessments Over Time</Card.Header>
<Card.Body>
<div style={{ width: '100%', height: '286px' }} className="recharts-wrapper">
<ResponsiveContainer>
<BarChart data={this.data}>
<CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="name" />
<Tooltip />
<YAxis
label={
<Text x={-30} y={60} dx={50} dy={150} offset={0} angle={-90}>
Number of Monitorees
</Text>
}
/>
<Bar dataKey="Asymptomatic Assessments" stackId="a" fill="#39CC7D" />
<Bar dataKey="Symptomatic Assessments" stackId="a" fill="#FF6868" />
</BarChart>
</ResponsiveContainer>
</div>
</Card.Body>
</Card>
</React.Fragment>
);
}
Example #2
Source File: MonitoringDistributionDay.js From SaraAlert with Apache License 2.0 | 6 votes |
render() {
const data = this.props.stats.monitoring_distribution_by_day;
return (
<React.Fragment>
<Card className="card-square">
<Card.Header as="h5">Monitoring Distribution by Day</Card.Header>
<Card.Body>
<h5 className="pb-4">DISTRIBUTION OF MONITOREES UNDER MONITORING</h5>
<div style={{ width: '100%', height: '286px' }} className="recharts-wrapper">
<ResponsiveContainer>
<BarChart data={data}>
<CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="day">
<Label value="Day of Monitoring" position="insideBottom" offset={-3} />
</XAxis>
<YAxis
label={
<Text x={-30} y={60} dx={50} dy={150} offset={0} angle={-90}>
Number of Monitorees
</Text>
}
/>
<Bar dataKey="cases" fill="#0E4F6D" />
</BarChart>
</ResponsiveContainer>
</div>
</Card.Body>
</Card>
</React.Fragment>
);
}
Example #3
Source File: MainSurveyBar.js From front-app with MIT License | 6 votes |
CustomizedAxisTick = (props) => {
const { x, y, payload } = props
return (
<Text x={x} y={y} width={75} fontSize={9} textAnchor="middle" verticalAnchor="start">
{payload.value}
</Text>
)
}