mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-20 23:28:10 +00:00
Update UptimeChart to take props from parent
This commit is contained in:
parent
1add11de03
commit
0e53d9bb78
@ -1,44 +1,6 @@
|
|||||||
|
|
||||||
import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts';
|
import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts';
|
||||||
// @NOTE: XAxis for months or days
|
// @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
|
|
||||||
},
|
|
||||||
{
|
|
||||||
//name: 'Feb',
|
|
||||||
pv: 1,
|
|
||||||
pa: 1
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
interface DataItem {
|
interface DataItem {
|
||||||
name?: string;
|
name?: string;
|
||||||
@ -46,7 +8,11 @@ interface DataItem {
|
|||||||
pv: number;
|
pv: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const UptimeChart = () => {
|
type UptimeChartProps = {
|
||||||
|
data: DataItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const UptimeChart = ({ data }: UptimeChartProps) => {
|
||||||
return (
|
return (
|
||||||
<ResponsiveContainer >
|
<ResponsiveContainer >
|
||||||
<BarChart
|
<BarChart
|
||||||
|
Loading…
x
Reference in New Issue
Block a user