legend order for mixed charts. #29773
Replies: 7 comments 8 replies
-
To achieve the desired legend order for your mixed chart, you can use the Here is how you can configure the sorting options in the Superset UI:
Here is the relevant code snippet for these controls:
These controls allow you to dynamically alter the legend order through the frontend without modifying the core codebase [1]. If you need to implement a custom legend order, you would need to modify the
This modification allows you to pass a custom order for the legend items directly in the chart's configuration [2]. |
Beta Was this translation helpful? Give feedback.
-
i want achieve this for specific chart using json metadata |
Beta Was this translation helpful? Give feedback.
-
Hi where should i put the above code ? |
Beta Was this translation helpful? Give feedback.
-
Hi Give me a solution where i can achieve this by using json meta data |
Beta Was this translation helpful? Give feedback.
-
Hi |
Beta Was this translation helpful? Give feedback.
-
Hi Is there any alternative solution to achieve this using JSON meta data? |
Beta Was this translation helpful? Give feedback.
-
Hi This is my change for the particular mixed chart but its not getting saved as i navigate to json metadata after save i don't see my changes |
Beta Was this translation helpful? Give feedback.
-
Guys,
suppose i have a Time series mixed chart.
and my legend order is
![image](https://private-user-images.githubusercontent.com/146916481/353313537-e53ecbca-88af-4140-a424-1ca45bf01804.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjU3NTYsIm5iZiI6MTczOTI2NTQ1NiwicGF0aCI6Ii8xNDY5MTY0ODEvMzUzMzEzNTM3LWU1M2VjYmNhLTg4YWYtNDE0MC1hNDI0LTFjYTQ1YmYwMTgwNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQwOTE3MzZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02NTcxOGMwZGUxNzlmMGIxY2FlZjU0OTc5YTAzMmM0NTdhYTdkZmVkNWI3OTExYzE2MmMxNDcyYmRjNDA3MmQ4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.9o1WVM6dJ7FjLqnjmJNTrQrF_GjEQji8-BIFydyZk8w)
i want my legend order to be Year1 year2 year3 year4+ Rolling 4 week average.
is there any option that can we alert this legend order ?
how to achieve this?
Here is the JSON metadata you need to add to set the legend order to "Year 1", "Year 2", "Year 3", "Year 4+", and "Rolling 4 week average":
{
"legend_order": ["Year 1", "Year 2", "Year 3", "Year 4+", "Rolling 4 week average"]
}
is there any alternative to do it from frontend but no codebase change?
Beta Was this translation helpful? Give feedback.
All reactions