Display a 'No Data' label on radar chart if there isnt any data

This commit is contained in:
Anthony Mineo 2020-04-10 10:56:56 -04:00
parent e601fe8e91
commit 063f6ba55b

View file

@ -43,7 +43,7 @@ export default function Player(props) {
spawnctf={props.playerData.player.total_games_sctfgame} spawnctf={props.playerData.player.total_games_sctfgame}
/> />
<RadarChart cx={300} cy={250} outerRadius={150} width={600} height={500} data={returnWeaponTotals(props.playerData.totals)} className="text-sm"> <RadarChart cx={300} cy={250} outerRadius={150} width={600} height={500} data={ returnWeaponTotals(props.playerData.totals).length ? returnWeaponTotals(props.playerData.totals) : [{ weapon: 'No Data', val:1}]} className="text-sm">
<PolarGrid /> <PolarGrid />
<PolarAngleAxis dataKey="weapon" /> <PolarAngleAxis dataKey="weapon" />
<PolarRadiusAxis/> <PolarRadiusAxis/>