Added gradient to area chart
This commit is contained in:
1 parent
2a1afc8610
commit
7e01006cef
4 files changed
+36
-16
No files matched your search
@@ -64,6 +64,8 @@ const MonitorDetailsAreaChart = ({ checks }) => {
|
||||
});
|
||||
};
|
||||
|
||||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<ResponsiveContainer width="100%" height="100%">
|
||||
<AreaChart
|
||||
@@ -77,6 +79,20 @@ const MonitorDetailsAreaChart = ({ checks }) => {
|
||||
bottom: 0,
|
||||
}}
|
||||
>
|
||||
<defs>
|
||||
<linearGradient id="colorUv" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop
|
||||
offset="0%"
|
||||
stopColor={theme.palette.primary.main}
|
||||
stopOpacity={0.8}
|
||||
/>
|
||||
<stop
|
||||
offset="100%"
|
||||
stopColor={theme.palette.primary.light}
|
||||
stopOpacity={0}
|
||||
/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<XAxis
|
||||
dataKey="createdAt"
|
||||
tickFormatter={formatDate}
|
||||
@@ -87,8 +103,8 @@ const MonitorDetailsAreaChart = ({ checks }) => {
|
||||
<Area
|
||||
type="monotone"
|
||||
dataKey="responseTime"
|
||||
stroke="#29afee"
|
||||
fill="#eaf2fd"
|
||||
stroke={theme.palette.primary.main}
|
||||
fill="url(#colorUv)"
|
||||
/>
|
||||
</AreaChart>
|
||||
</ResponsiveContainer>
|
||||
|
||||
Reference in new issue
Block a user