Fix stack chart issue when there is no data for one area #3229
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.
JIRA: https://issues.redhat.com/browse/RHOAIENG-11048
Description
This is a known issue in Victory chart, and I am taking the workaround as suggested by the PF team here patternfly/patternfly-react#10978 (comment). If there is no data, we render it as
[null]
instead of[]
, which fixes the issue.How Has This Been Tested?
I met some problems with generating the real data points, but you can go to the cypress test server and check the test case
Serving Chart Shows Data
Way to compare:
cypress:server
andcypress:open:mock
in 2 terminalsit.only
to theServing Chart Shows Data
test so we can check the screenshotmodelMetrics
test to check if it renders incorrectlycypress:server:build
and re-run step 1-3Test Impact
Update the test cases to see the mocked data better.
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main