Fix tooltip content logic in bar_chart_goals function to handle null values and improve readability.#44
Conversation
cnavarro-prestashop
commented
Mar 27, 2026
| Questions | Answers |
|---|---|
| Description? | Fix tooltip content logic in bar_chart_goals function to handle null values and improve readability. |
| Type? | bug fix |
| BC breaks? | no |
| Deprecations? | no |
| Fixed ticket? | - |
| How to test? | Display dash forecast |
…values and improve readability.
|
Hello @cnavarro-prestashop! This is your first pull request on dashgoals repository of the PrestaShop project. Thank you, and welcome to this Open Source community! |
SiraDIOP
left a comment
There was a problem hiding this comment.
Hello @cnavarro-prestashop ,
I tested this PR on PS 9.2.0 with Docker.
✅ No regression observed
✅ No undefined displayed on bar hover
✅ Forecast widget loads correctly with real data
nvd3 warning: `tooltipContent` has been deprecated. use chart.tooltip.contentGenerator() instead
It seems the tooltipContent method is deprecated in the version of nvd3 used by PS 9.x, which prevents the tooltip from rendering entirely.
The null value fix looks good, but it might be worth migrating to chart.tooltip.contentGenerator() to ensure the tooltip actually displays on PS 9.
Enregistrement.de.l.ecran.2026-03-30.a.17.01.04.mov
Enregistrement.de.l.ecran.2026-03-30.a.17.15.11.mov
Did i miss something?
18aa5d9
|
Hi @SiraDIOP, Thanks for the test. I made modification you suggested about replacing method NVD3 tooltipContent by tooltip.contentGenerator. After checking with some test it seems Warning messages have completely disappeared from the console and now I've well the tooltip displayed : Enregistrement.de.l.ecran.2026-04-01.a.18.24.02.mov |
SiraDIOP
left a comment
There was a problem hiding this comment.
Hello @cnavarro-prestashop
Tested this PR on PS 9.1.0 with a fresh install of the dashgoals module. The tooltip displays correctly when hovering over the bars in the Forecast widget — it shows the sales value and the goal set as expected. ✅
Enregistrement.de.l.ecran.2026-04-02.a.17.08.31.mov
One thing noticed: when uninstalling and reinstalling the module, the Forecast widget moves to the bottom of the dashboard instead of staying in its original position. This seems unrelated to this PR but worth investigating separately.
|
One thing noticed: when uninstalling and reinstalling the module, the Forecast widget moves to the bottom of the dashboard instead of staying in its original position. This seems unrelated to this PR but worth investigating separately. That is what is expected |
|
Got it, thanks for the clarification! |
|
The CI is red; we need to update it. Thank you @SiraDIOP && @cnavarro-prestashop |