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={13} color='$red'>-2%</Text>
</XStack>
<XStack width={'100%'} height={'50%'} justifyContent="center" alignItems="center">
<Stack style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', width: '80%', height: '100%' }}>
<XStack height={'50%'} justifyContent="center" alignItems="center">
<Stack style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', width: '228px', height: '100%' }}>
<UptimeChart />
</Stack>
</XStack>

View File

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