render() { const { courses } = this.state; if (courses.length === 0) return null; return ( <Paper style={{ height: 'fit-content', margin: 'auto' }} depth={1}> <VictoryLabel text="My Courses" x={225} y={30} textAnchor="middle" style={{ fontSize: 25 }} /> <VictoryPie data={courses} labelRadius={130} theme={VictoryTheme.material} x="subject" y="count" colorScale={colours} /> </Paper> ); }