Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sunburst is not using linear color scheme when secondary metric is provided #20150

Closed
3 tasks done
lfkpoa opened this issue May 20, 2022 · 0 comments
Closed
3 tasks done
Assignees
Labels
#bug Bug report preset:cares Preset cares about this issue

Comments

@lfkpoa
Copy link

lfkpoa commented May 20, 2022

The sunburst chart allows to provide the primary metric and a secondary metric.
On Customize it is possible to choose a color scheme and a linear color scheme.
The hint on linear color scheme is "When a secondary metric is provided, a linear color scale is used.".
However, the linear color scheme is never used, even if I provide the second metric.
It is not possible to unselect or clear the color scheme.

Sunburst.js (line 492) tests the condition to set colorByCategory to false when the secondary metric is provided and is diferente than the primary metric.
However, it also checks if the colorScheme was not provided:

if (metrics[0] !== metrics[1] && metrics[1] && !colorScheme ) {

But colorScheme is always present since there is no way to clear it.
I tried commenting the !colorScheme test and the chart seemed to work properly.
It used the linear color scheme correctly when I provided the secondary metric and used de color scheme by category otherwise.

Expected results

I expected that the linear color scheme would be used instead of the color scheme based on categories.

Actual results

It keeps using the color scheme based on categories even when the secondary metric is used.

I'm running docker-compose up based on main branch.

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report preset:cares Preset cares about this issue
Projects
None yet
Development

No branches or pull requests

2 participants