Skip to content

Commit 51054d1

Browse files
committed
fix: chart and tooltip for values of null
For example for `proposal efficiency` or `sync efficiency` values can also be `null`. In the chart there should not be a value (instead of `0`) and in tooltip there shouldn't be `percentage calculation`. See: BEDS-1548
1 parent d60e318 commit 51054d1

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

frontend/.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"BcTooltip",
1616
"DashboardChartSummary",
1717
"DashboardChartSummaryFilter",
18+
"DashboardChartSummaryTooltip",
1819
"DashboardGroupManagementModal",
1920
"DashboardSlotViz",
2021
"DashboardTableClDeposits",

frontend/components/dashboard/chart/DashboardChartSummary.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,10 @@ const loadData = async () => {
208208
name = getGroupLabel($t, element.id, groups.value, allGroups)
209209
}
210210
211-
const data = element.data.map(datapoint => datapoint !== undefined ? datapoint * 100 : undefined)
211+
const data = element.data.map(datapoint => datapoint === null
212+
? null
213+
: datapoint * 100,
214+
)
212215
213216
const newObj: SeriesOption = {
214217
connectNulls: false,

frontend/components/dashboard/chart/DashboardChartSummaryTooltip.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ defineProps<Props>()
4646
<div class="name">
4747
{{ entry.name }}:
4848
</div>
49+
<span v-if="typeof entry.efficiency !== 'number'">
50+
-
51+
</span>
4952
<BaseFormatPercent
53+
v-else
5054
class="efficiency"
5155
:value="entry.efficiency / 100"
5256
/>

0 commit comments

Comments
 (0)