Fix aggregate chart xaxis labels#1922
Merged
aestoltm merged 6 commits intoubccr:xdmod11.0from Jan 2, 2025
Merged
Conversation
…y from xAxis object instead of using yAxisObject->getXValue()
Member
|
There seem to be more bars in the second plot than the first one. How come? |
Contributor
Author
It looks like there are more bars on xdmod-dev even without the proposed changes. |
jpwhite4
approved these changes
Jan 2, 2025
aaronweeden
pushed a commit
to aaronweeden/xdmod
that referenced
this pull request
Feb 10, 2025
Fix aggregate chart xaxis labels by correctly using xAxis values array from xAxis object instead of using yAxisObject->getXValue()
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.
Description
Fix aggregate chart xaxis labels when multiple statistics are plotted for a single yaxis object. The issue was that with multiple aggregate data series, the first trace determines the x axis labels for the chart. If the following data series objects contain xvalues that are not within the first trace then those values are ignored (null'ed).
The following snippet shows how the xvalues for each yaxis object starts as an empty array of null values. Values are only updated if a match exists within the xAxis object. Looking at
getYAxis()in ComplexDataset.phpThe reason this was not an issue before is that Highcharts set categorical axis labels through the xAxis object, whereas, Plotly JS has its category labels set through the data object itself. This should have been changed from the start of the transistion to Plotly to use the xAxis object to receive the xAxis values.
Before:

After:

Motivation and Context
Aggregate charts that contain multiple statistics at once will have blank labels if the label does not exist in every trace.
Tests performed
Tested on my dev port
Checklist: