fix data and style

This commit is contained in:
Hristo Nedelkov 2023-09-15 13:12:33 +03:00
parent 9173d42611
commit ae8cd99602
2 changed files with 18 additions and 32 deletions

View File

@ -17,8 +17,8 @@ const ConsensusUptimeCard = () => {
<Text size={27} weight={'semibold'}>98%</Text> <Text size={27} weight={'semibold'}>98%</Text>
<Text size={13} color='$red'>-2%</Text> <Text size={13} color='$red'>-2%</Text>
</XStack> </XStack>
<XStack width={'100%'} height={'50%'} justifyContent="center" alignItems="center"> <XStack height={'50%'} justifyContent="center" alignItems="center">
<Stack style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', width: '80%', height: '100%' }}> <Stack style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', width: '228px', height: '100%' }}>
<UptimeChart /> <UptimeChart />
</Stack> </Stack>
</XStack> </XStack>

View File

@ -3,53 +3,42 @@ import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, Responsive
const data: DataItem[] = [ const data: DataItem[] = [
{ {
pv: 1,
uv: 4000, pa: 1
pv: 2400,
amt: 2400,
}, },
{ {
uv: 3000, pv: 0,
pv: 1398, pa: 0
amt: 2210,
}, },
{ {
uv: 2000, pv: 1,
pv: 9800, pa: 0
amt: 2290,
}, },
{ {
uv: 2780, pv: 0,
pv: 3908, pa: 0
amt: 2000,
}, },
{ {
uv: 1890, pv: 0,
pv: 4800, pa: 0
amt: 2181,
}, },
{ {
pv: 1,
uv: 2390, pa: 1
pv: 3800,
amt: 2500,
}, },
{ {
pv: 1,
uv: 3490, pa: 1
pv: 4300,
amt: 2100,
}, },
]; ];
interface DataItem { interface DataItem {
uv: number; pa: number;
pv: number; pv: number;
amt: number;
} }
@ -59,14 +48,11 @@ const UptimeChart = () => {
<BarChart <BarChart
data={data} data={data}
margin={{ margin={{
top: 5,
right: 30,
left: 20,
bottom: 5,
}} }}
style={{ backgroundColor: '#F0F2F5' }} style={{ backgroundColor: '#F0F2F5' }}
> >
<Bar dataKey="pv" barSize={2} fill="#E95460" /> <Bar dataKey="pv" barSize={2} fill="#E95460" />
<Bar dataKey="pa" barSize={2} fill="#E95460" />
</BarChart> </BarChart>
</ResponsiveContainer> </ResponsiveContainer>
); );