Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ChartReportPage.jsx #1316

Merged
merged 5 commits into from
Dec 28, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/reports/ChartReportPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
FormControl, InputLabel, Select, MenuItem, useTheme,
} from '@mui/material';
import {
CartesianGrid, Line, LineChart, ResponsiveContainer, Tooltip, XAxis, YAxis,
Brush, CartesianGrid, Line, LineChart, ResponsiveContainer, Tooltip, XAxis, YAxis,
} from 'recharts';
import ReportFilter from './components/ReportFilter';
import { formatTime } from '../common/util/formatter';
Expand All @@ -20,6 +20,9 @@
import useReportStyles from './common/useReportStyles';

const ChartReportPage = () => {
const [, setZoomDomain] = useState({ start: 'dataMin', end: 'dataMax' });
const handleBrushChange = (range) => { if (range) { setZoomDomain({ start: range.startIndex, end: range.endIndex }); } };
hypoclone marked this conversation as resolved.
Show resolved Hide resolved

Check failure on line 25 in src/reports/ChartReportPage.jsx

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
const classes = useReportStyles();
const theme = useTheme();
const t = useTranslation();
Expand Down Expand Up @@ -161,7 +164,20 @@
formatter={(value, key) => [value, positionAttributes[key]?.name || key]}
labelFormatter={(value) => formatTime(value, 'seconds')}
/>
<Line type="monotone" dataKey={type} stroke={theme.palette.primary.main} />
<Brush
dataKey={timeType}
height={30}
stroke={theme.palette.primary.main}
tickFormatter={() => ''}
hypoclone marked this conversation as resolved.
Show resolved Hide resolved
onChange={(range) => handleBrushChange(range)}
/>
<Line

Check failure on line 174 in src/reports/ChartReportPage.jsx

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
type="monotone"
dataKey={type}
stroke={theme.palette.primary.main}
dot={false}
activeDot={{ r: 6 }}
/>
</LineChart>
</ResponsiveContainer>
</div>
Expand Down
Loading