feat: added logic to fill invalid value with null, so the chart don't have broken lines#7412
Merged
SagarRajput-7 merged 4 commits intomainfrom Mar 24, 2025
Merged
feat: added logic to fill invalid value with null, so the chart don't have broken lines#7412SagarRajput-7 merged 4 commits intomainfrom
SagarRajput-7 merged 4 commits intomainfrom
Conversation
…have broken lines
amlannandy
approved these changes
Mar 24, 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.
Summary
Time series charts in SigNoz display disconnected/broken lines when encountering invalid data points such as
+Inf,+Infinity,NaN, or other non-numeric values. This creates a poor visualization experience and makes it difficult for users to interpret the data.Solution
This PR adds functionality to properly handle invalid plot values by replacing them with
nullvalues, which ensures chart lines remain connected. The implementation:Adds two new utility functions in
dataUtils.ts:isInvalidPlotValue(): Checks for invalid values (null,undefined,NaN,Infinity, etc.)normalizePlotValue(): Converts invalid values tonulland string numbers to actual numbersUpdates
fillMissingXAxisTimestamps()ingetUplotChartData.tsto use the new normalization functionBenefits
Related Issues / PR's
+infin b/w points #5662Screenshots
Affected Areas and Manually Tested Areas
+Infinity,NaN, andundefinedImportant
Adds logic to replace invalid plot values with null to prevent broken chart lines, using new utility functions in
dataUtils.ts.isInvalidPlotValue()andnormalizePlotValue()indataUtils.tsto handle invalid plot values by replacing them withnull.fillMissingXAxisTimestamps()ingetUplotChartData.tsto usenormalizePlotValue()for value normalization.isInvalidPlotValue(): Checks fornull,undefined,NaN,Infinity, and string representations of these values.normalizePlotValue(): Converts invalid values tonulland string numbers to actual numbers.This description was created by
for 293f99f. It will automatically update as commits are pushed.