apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
63.16k stars 13.99k forks source link

Confidence Interval Does not work properly for Mixed Charts #30554

Open vedantprajapati17 opened 1 month ago

vedantprajapati17 commented 1 month ago

Bug description

I’ve noticed that the confidence intervals in charts do not display correctly at all after Superset 3. There was also an issue previously that it wouldn’t show negative values of confidence intervals. The way to set them up is using (name_yhat for actual value; nameyhat_upper for upper bound; and name_yhat_lower for lower bound). However, they now result in unexpected behaviour.

Prior to the superset 3.0, the intervals would only work for positive values. If an interval goes into the negative it is not plotted, and only the positive values are. If the full chart is in the negative domain the confidence interval is plotted in the positive area.

What is currently being sent

What should actually be sent

Modifying the order of the inputs currently has an impact on how the behaviour of the mixed charts works due to a bug in echarts. This aims to resolve that issue on superset's end

Screenshots/recordings

No response

Superset version

3.1.3

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

dosubot[bot] commented 1 month ago

Hey @vedantprajapati17! I'm here to help you with any bugs, questions, or contributions. Let's get this sorted out together!

The issue you're experiencing with confidence intervals in mixed charts after Superset 3.0 might be related to how negative values are handled. Superset's ECharts integration has a known limitation where confidence bands are not rendered in stack or area charts, which might affect how negative intervals are displayed [1].

Additionally, if the intervals are not displaying correctly, it could be due to a bug in ECharts or the way Superset processes the data. You might want to check if the data is being transformed correctly before rendering.

If modifying the order of inputs affects the behavior, it could be a workaround for the current bug. Ensuring that the data is structured correctly with name_yhat, name_yhat_upper, and name_yhat_lower is crucial.

For a more specific solution, reviewing the data transformation logic in the transformProps function might help identify any issues with how confidence intervals are processed.

To continue talking to Dosu, mention @dosu.