Sunburst is not using linear color scheme when secondary metric is provided
lfkpoa opened this issue · comments
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.