Draft
Fix hover tooltip showing wrong values when valueMap contains numeric strings#269
Conversation
Co-authored-by: mbehr1 <3258891+mbehr1@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Hover data points are wrong if values are coming from a valueMap where the values are numbers
Fix hover tooltip showing wrong values when valueMap contains numeric strings
Aug 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The hover tooltip in graphical reports was displaying incorrect values when
reportOptions.valueMapmapped values to strings that could be interpreted as numbers. For example, if a value was mapped to"8", the tooltip would show1instead of8.Root Cause
The issue occurred because Chart.js uses category-type axes when
valueMapis present, and internally represents data points using array indices rather than the actual mapped values. The tooltip callback was accessingitem.parsed.yoritem.formattedValue, which returned the chart position (index) instead of the actual data value.Solution
Modified the tooltip callback in
regularGraphs.jsto:valuesMappropertyitem.dataset.data[item.dataIndex].yinstead of the parsed chart positionvaluesMapAlso updated
timeSeriesReport.htmlto include thevaluesMapin the dataset configuration so it's accessible to the tooltip callback.Example
Before fix:
"8"displays as1in tooltip (chart index)After fix:
"8"correctly displays as8in tooltip (actual value)The fix maintains backward compatibility - datasets without
valuesMapcontinue to work exactly as before.Fixes #268.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
hg.mozilla.orgnode ./dist/install.js(dns block)https://api.github.com/repos/mbehr1/adlt/releases/tags/v0.62.0node ./lib/postinstall.js(http block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.