Skip to content

Commit

Permalink
Merge pull request #2791 from objectcomputing/feature-2790/bar-chart-…
Browse files Browse the repository at this point in the history
…responses

#2790 - Added a bar chart per day showing the number of responses.
  • Loading branch information
mkimberlin authored Dec 17, 2024
2 parents 7299006 + b401698 commit ed83bb9
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions web-ui/src/pages/PulseReportPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
CartesianGrid,
Legend,
Line,
LineChart,
ComposedChart,
ResponsiveContainer,
Tooltip,
XAxis,
Expand Down Expand Up @@ -48,7 +48,7 @@ import './PulseReportPage.css';
// Recharts doesn't support using CSS variables, so we can't
// easily use color variables defined in variables.css.
const ociDarkBlue = '#2c519e';
//const ociLightBlue = '#76c8d4'; // not currently used
const ociLightBlue = '#76c8d4';
// const ociOrange = '#f8b576'; // too light
const orange = '#b26801';

Expand Down Expand Up @@ -209,7 +209,8 @@ const PulseReportPage = () => {
{
date: day.date,
internal: day.datapoints.reduce((acc, current) => acc + current.internalScore, 0)/day.datapoints.length,
external: day.datapoints.reduce((acc, current) => acc + current.externalScore, 0)/day.datapoints.length
external: day.datapoints.reduce((acc, current) => acc + current.externalScore, 0)/day.datapoints.length,
responses: day.datapoints.length,
}
)));
setBarChartData(frequencies);
Expand Down Expand Up @@ -436,7 +437,7 @@ const PulseReportPage = () => {
/>
<CardContent>
<ResponsiveContainer width="100%" aspect={3.0}>
<LineChart data={lineChartData} height={300}>
<ComposedChart data={lineChartData} height={300}>
<CartesianGrid strokeDasharray="3 3" />
<XAxis
angle={-90}
Expand All @@ -449,18 +450,24 @@ const PulseReportPage = () => {
<Tooltip />
<Legend />
<Line
type="monotone"
dataKey="internal"
stroke={ociDarkBlue}
dot={false}
type="monotone"
/>
<Line
dataKey="external"
dot={false}
stroke={orange}
type="monotone"
/>
</LineChart>
<Bar
dataKey="responses"
barSize={20}
fill={ociLightBlue}
type="monotone"
/>
</ComposedChart>
</ResponsiveContainer>
</CardContent>
</Card>
Expand Down

0 comments on commit ed83bb9

Please sign in to comment.