Skip to content

Commit

Permalink
was getting wrong name on tooltip and if nan than show it as -
Browse files Browse the repository at this point in the history
  • Loading branch information
ktx-vaidehi committed May 1, 2024
1 parent 1f674a2 commit b61e776
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web/src/utils/dashboard/convertGeoMapData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export const convertGeoMapData = (panelSchema: any, mapData: any) => {
backgroundColor: "rgba(255,255,255,0.8)",
formatter: function (params: any) {
let formattedValue = params.value;
if (getUnitValue && formatUnitValue) {
if (formattedValue === "-" || isNaN(formattedValue)) {
formattedValue = "-";
} else if (getUnitValue && formatUnitValue) {
formattedValue = formatUnitValue(
getUnitValue(
formattedValue,
Expand All @@ -50,7 +52,7 @@ export const convertGeoMapData = (panelSchema: any, mapData: any) => {
);
}

return `${params.seriesName}: ${formattedValue}`;
return `${params.name}: ${formattedValue}`;
},
};

Expand Down

0 comments on commit b61e776

Please sign in to comment.