Version
5.4.2
Link to Minimal Reproduction
Steps to Reproduce
- Use visualMap.piecewise using dedicated dimension to apply color and label on a scatter.
- Define pieces for values of type strings with custom labels to assign a label "No info" to an empty string value :
Current Behavior
In the visualMap display, items seem to be ordered by value.
Expected Behavior
Items in the visualMap should be ordered by order of definition in pieces.
Environment
- OS: Windows 10
- Browser: Chrome 114
- Framework: ECharts examples official editor
Any additional comments?
I can't find any workaround as using categories and inRange instead of pieces allows to choose the order but not to have custom labels. Let me know if there's a way to do that.
2条答案
按热度按时间mepcadol1#
I can't find any workaround as using categories and inRange instead of pieces allows to choose the order
when using categories make sure all of them exist in the data. Instead of empty string, there should be category 'No info'.
Demo Code
093gszye2#
Yes it's a good workaround, thank you.
It still isn't perfect as I have to alter my dataset (replace all "" with "No info").