From 024732e9c257ee45e364e3047047ca66d2da1f88 Mon Sep 17 00:00:00 2001 From: muhammad-ammar Date: Wed, 13 Nov 2024 15:52:01 +0500 Subject: [PATCH] fix: analytics v2 --- src/components/AdvanceAnalyticsV2/charts/BarChart.jsx | 2 +- src/components/AdvanceAnalyticsV2/charts/LineChart.jsx | 1 - src/components/AdvanceAnalyticsV2/tabs/Completions.jsx | 2 +- src/components/AdvanceAnalyticsV2/tabs/Engagements.jsx | 2 +- src/components/AdvanceAnalyticsV2/tabs/Enrollments.jsx | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/AdvanceAnalyticsV2/charts/BarChart.jsx b/src/components/AdvanceAnalyticsV2/charts/BarChart.jsx index d9bf6d1731..e620b56d25 100644 --- a/src/components/AdvanceAnalyticsV2/charts/BarChart.jsx +++ b/src/components/AdvanceAnalyticsV2/charts/BarChart.jsx @@ -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); diff --git a/src/components/AdvanceAnalyticsV2/charts/LineChart.jsx b/src/components/AdvanceAnalyticsV2/charts/LineChart.jsx index be4dd17bd9..0e893865c3 100644 --- a/src/components/AdvanceAnalyticsV2/charts/LineChart.jsx +++ b/src/components/AdvanceAnalyticsV2/charts/LineChart.jsx @@ -41,7 +41,6 @@ const LineChart = ({ }, xaxis: { title: xAxisTitle }, yaxis: { title: yAxisTitle }, - dragmode: false, autosize: true, }; diff --git a/src/components/AdvanceAnalyticsV2/tabs/Completions.jsx b/src/components/AdvanceAnalyticsV2/tabs/Completions.jsx index 9b470ce77b..9e5d35d54f 100644 --- a/src/components/AdvanceAnalyticsV2/tabs/Completions.jsx +++ b/src/components/AdvanceAnalyticsV2/tabs/Completions.jsx @@ -138,7 +138,7 @@ const Completions = ({ chartType="BarChart" chartProps={{ data: data?.topCoursesByCompletions, - xKey: 'courseTitle', + xKey: 'courseKey', yKey: 'completionCount', colorKey: 'enrollType', colorMap: chartColorMap, diff --git a/src/components/AdvanceAnalyticsV2/tabs/Engagements.jsx b/src/components/AdvanceAnalyticsV2/tabs/Engagements.jsx index 5f5396ffa0..5bf4085d20 100644 --- a/src/components/AdvanceAnalyticsV2/tabs/Engagements.jsx +++ b/src/components/AdvanceAnalyticsV2/tabs/Engagements.jsx @@ -137,7 +137,7 @@ const Engagements = ({ chartType="BarChart" chartProps={{ data: data?.topCoursesByEngagement, - xKey: 'courseTitle', + xKey: 'courseKey', yKey: 'learningTimeHours', colorKey: 'enrollType', colorMap: chartColorMap, diff --git a/src/components/AdvanceAnalyticsV2/tabs/Enrollments.jsx b/src/components/AdvanceAnalyticsV2/tabs/Enrollments.jsx index 5d7940d2e1..357d083d2e 100644 --- a/src/components/AdvanceAnalyticsV2/tabs/Enrollments.jsx +++ b/src/components/AdvanceAnalyticsV2/tabs/Enrollments.jsx @@ -138,7 +138,7 @@ const Enrollments = ({ chartType="BarChart" chartProps={{ data: data?.topCoursesByEnrollments, - xKey: 'courseTitle', + xKey: 'courseKey', yKey: 'enrollmentCount', colorKey: 'enrollType', colorMap: chartColorMap,