Proper Scale for Charts
This commit is contained in:
@ -30,7 +30,8 @@ export default function PlayerGameStatsDrawer({player, game, open, setOpen} : {p
|
|||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<LineChart xAxis={[{data : trackedTime?.map(t => new Date(t.timeStamp))??[], scaleType: "utc", label: "Date"}]}
|
<LineChart xAxis={[{data : trackedTime?.map(t => new Date(t.timeStamp))??[], scaleType: "utc", label: "Date"}]}
|
||||||
series={[{data: trackedTime?.map(t => Number(t.timePlayed))??[], label: "Minutes Played"}]}
|
yAxis={[{label: "Minutes Played", scaleType: "linear", min: 0}]}
|
||||||
|
series={[{data: trackedTime?.map(t => Number(t.timePlayed))??[], label: game?.name}]}
|
||||||
sx={{height: "80%"}}/>
|
sx={{height: "80%"}}/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
@ -78,7 +78,7 @@ export function PlayerStatsDrawer({player, open, setOpen}: {
|
|||||||
/>
|
/>
|
||||||
<LineChart dataset={trackedTimes}
|
<LineChart dataset={trackedTimes}
|
||||||
xAxis={[{dataKey: "date", scaleType: "utc"}]}
|
xAxis={[{dataKey: "date", scaleType: "utc"}]}
|
||||||
yAxis={[{dataKey: "time", scaleType: "linear"}]}
|
yAxis={[{dataKey: "time", scaleType: "linear", min: 0}]}
|
||||||
series={selectedSeries}
|
series={selectedSeries}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
Reference in New Issue
Block a user