Skip to content

Commit

Permalink
fix: analytics v2
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammad-ammar committed Nov 13, 2024
1 parent dd5c77d commit 024732e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/AdvanceAnalyticsV2/charts/BarChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import PropTypes from 'prop-types';
const BarChart = ({
data, xKey, yKey, colorKey, colorMap, hovertemplate, xAxisTitle, yAxisTitle,
}) => {
const categories = Object.keys(colorMap);
const categories = Object.keys(colorMap).sort();

const traces = useMemo(() => categories.map(category => {
const filteredData = data.filter(item => item[colorKey] === category);
Expand Down
1 change: 0 additions & 1 deletion src/components/AdvanceAnalyticsV2/charts/LineChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const LineChart = ({
},
xaxis: { title: xAxisTitle },
yaxis: { title: yAxisTitle },
dragmode: false,
autosize: true,
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/AdvanceAnalyticsV2/tabs/Completions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const Completions = ({
chartType="BarChart"
chartProps={{
data: data?.topCoursesByCompletions,
xKey: 'courseTitle',
xKey: 'courseKey',
yKey: 'completionCount',
colorKey: 'enrollType',
colorMap: chartColorMap,
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdvanceAnalyticsV2/tabs/Engagements.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const Engagements = ({
chartType="BarChart"
chartProps={{
data: data?.topCoursesByEngagement,
xKey: 'courseTitle',
xKey: 'courseKey',
yKey: 'learningTimeHours',
colorKey: 'enrollType',
colorMap: chartColorMap,
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdvanceAnalyticsV2/tabs/Enrollments.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const Enrollments = ({
chartType="BarChart"
chartProps={{
data: data?.topCoursesByEnrollments,
xKey: 'courseTitle',
xKey: 'courseKey',
yKey: 'enrollmentCount',
colorKey: 'enrollType',
colorMap: chartColorMap,
Expand Down

0 comments on commit 024732e

Please sign in to comment.