fix: Reordering echart props to fix confidence interval in Mixed Charts #30716
+35
−2
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.
fix(echarts): confidence interval does not display correctly for mixed time series charts with negative values
SUMMARY
The root cause of this problem lies within the order of the arguments sent to the echarts library. When working with time-series data, Echarts enforces specific constraints on how the x-axis bounds are configured. These constraints include:
In other words, the Echarts Library accepts input in this specific format and will malfunction otherwise. Superset does not create the Echarts modal with the options in this order.
xaxis.type
option must be explicitly set to'time'
.upper
andlower
bound values must be equal to the lower bound.upper
bound must be defined before thelower
bound in the options object.Currently, the code in Superset that generates the Echarts configuration does not adhere to this required format, leading to the observed malfunction. This pull request rectifies this issue by reordering the
upper
andlower
bound arguments before they are passed to the Echarts library.What is currently being sent
What should actually be sent
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
create a mixed chart on the explore menu using confidence intervals where the names__yhat_lower bound is negative at least once.
Verify that confidence Intervals behave as Intended.
names__yhat: trend/point estimate
names__yhat_lower: lower confidence level
names__yhat_upper: upper confidence level
ADDITIONAL INFORMATION
Fixes #30554