Skip to content

Commit

Permalink
Fix for tooltips not showing values
Browse files Browse the repository at this point in the history
When displaying tooltips, they only contain values ​​greater than zero. This is done by filtering:

`.filter(item => item.formattedValue > 0)`

However, `formattedValue` is a string, and additionally - if I understand correctly - formatted according to the user's local settings. This causes situations where values ​​greater than zero are incorrectly filtered out. Therefore, we should refer to the `raw` parameter:

`.filter(item => item.raw> 0)`

Closes #8
  • Loading branch information
maciek-szn authored Aug 10, 2024
1 parent b8b6bdd commit e047d0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/livewire/requests-graph.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class="h-52 ring-1 ring-gray-900/5 dark:ring-gray-100/10 bg-gray-50 dark:bg-gray
intersect: false,
callbacks: {
beforeBody: (context) => context
.filter(item => item.formattedValue > 0)
.filter(item => item.raw > 0)
.map(item => `${item.dataset.label}: ${data.sampleRate < 1 ? '~' : ''}${item.formattedValue}`)
.join(', '),
label: () => null,
Expand Down

0 comments on commit e047d0c

Please sign in to comment.