diff --git a/web/components/analytics/custom-analytics/graph/index.tsx b/web/components/analytics/custom-analytics/graph/index.tsx index 9c9fff9ad..181eec8bd 100644 --- a/web/components/analytics/custom-analytics/graph/index.tsx +++ b/web/components/analytics/custom-analytics/graph/index.tsx @@ -3,7 +3,7 @@ import { BarDatum } from "@nivo/bar"; // components import { CustomTooltip } from "./custom-tooltip"; // ui -import { BarGraph } from "components/ui"; +import { BarGraph, Tooltip } from "components/ui"; // helpers import { findStringWithMostCharacters } from "helpers/array.helper"; import { generateBarColor, generateDisplayName } from "helpers/analytics.helper"; @@ -72,42 +72,50 @@ export const AnalyticsGraph: React.FC = ({ analytics, barGraphData, param renderTick: params.x_axis === "assignees__id" ? (datum) => { - const avatar = analytics.extras.assignee_details?.find( - (a) => a?.assignees__display_name === datum?.value - )?.assignees__avatar; + const assignee = analytics.extras.assignee_details?.find((a) => a?.assignees__id === datum?.value); - if (avatar && avatar !== "") + if (assignee?.assignees__avatar && assignee?.assignees__avatar !== "") return ( - - - + + + + + ); else return ( - - - - {params.x_axis === "assignees__id" - ? datum.value && datum.value !== "None" - ? generateDisplayName(datum.value, analytics, params, "x_axis")[0].toUpperCase() - : "?" - : datum.value && datum.value !== "None" - ? `${datum.value}`.toUpperCase()[0] - : "?"} - - + + + + + {params.x_axis === "assignees__id" + ? datum.value && datum.value !== "None" + ? generateDisplayName(datum.value, analytics, params, "x_axis")[0].toUpperCase() + : "?" + : datum.value && datum.value !== "None" + ? `${datum.value}`.toUpperCase()[0] + : "?"} + + + ); } : (datum) => ( - - + + 7 ? "-rotate-45" : ""}`} + > {generateDisplayName(datum.value, analytics, params, "x_axis")}