Add notes for (add months labels)

This commit is contained in:
Hristo Nedelkov 2023-09-15 13:22:53 +03:00
parent ae8cd99602
commit fa4a5a37ec
1 changed files with 32 additions and 25 deletions

View File

@ -1,42 +1,47 @@
import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts';
// @NOTE: XAxis for months or days
const data: DataItem[] = [
{
// @NOTE: if you want to add name in the XAxis. You need to set the names here
// name: 'Jan',
pv: 1,
pa: 1,
},
{
// name: 'Feb',
pv: 0 ,
pa: 0
},
{
//name: 'Feb',
pv: 1,
pa: 0
},
{
//name: 'Feb',
pv: 0,
pa: 0
},
{
//name: 'Feb',
pv: 0,
pa: 0
},
{
//name: 'Feb',
pv: 1,
pa: 1
},
{
pv: 0,
pa: 0
},
{
pv: 1,
pa: 0
},
{
pv: 0,
pa: 0
},
{
pv: 0,
pa: 0
},
{
pv: 1,
pa: 1
},
{
//name: 'Feb',
pv: 1,
pa: 1
},
];
interface DataItem {
name?: string;
pa: number;
pv: number;
}
@ -51,7 +56,9 @@ const UptimeChart = () => {
}}
style={{ backgroundColor: '#F0F2F5' }}
>
{/* <XAxis dataKey="name" fontSize={'10px'} width={50} /> */}
<Bar dataKey="pv" barSize={2} fill="#E95460" />
{/* <XAxis dataKey="name" fontSize={'10px'} width={50} /> */}
<Bar dataKey="pa" barSize={2} fill="#E95460" />
</BarChart>
</ResponsiveContainer>