Skip to content

Commit

Permalink
Fix: Single finding in chart (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
rutujaac committed Apr 12, 2024
1 parent ff2c85c commit db19af9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pebblo/app/pebblo-ui/src/components/chartCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ export const ChartCard = (props) => {
let showTitlesForValues = [];
if (chartData?.length > 0) {
sortedData = SORT_DATA([...chartData], "desc", "value");
showTitlesForValues = [sortedData[0].value, sortedData[1].value];
if (sortedData?.length > 1) {
showTitlesForValues = [sortedData[0]?.value, sortedData[1]?.value];
} else if (sortedData?.length === 1) {
showTitlesForValues = [sortedData[0]?.value];
}
}
return /*html*/ `
<div class="flex flex-col w-100 gap-4">
Expand Down

0 comments on commit db19af9

Please sign in to comment.