echarts [Bug] visualMap-piecewise pieces order

0ejtzxu1  于 5个月前  发布在  Echarts
关注(0)|答案(2)|浏览(92)

Version

5.4.2

https://echarts.apache.org/examples/en/editor.html?c=scatter-matrix&code=PTAEGUGMAsFMFsCGAuAUCUATRAXWAaAQQEUBJASwDtNYAPfABQFkAmAOgFZGmBGABnwBhAPL4AcsJb5wk1JAD2lAM45QSmAkSgAvKADaqUKADeoSonixkoAOQkK1OjfygqNWtZ4u8tHNbtkNqAAvviGJmYWVrbMLBzOro4eoFKgPn4xTCmcQaHhpuaW_sz8CW501gDM3nQZNsygpSFhRgVR_iJlSdYALDW-HcK5LRGF0TYSLF3u1lxptf4SgEEEw_mRRbYyUy7lyQBs_XUyK81rY_6Akt6A5X7TFaAA7IeXNyGoALoA3HKKKqAATogAO4AEVwWl0BiMeg4cwAnC4OAdQHw2D0kTwABwuJE2QD2QQkbAAhWDkABWVAA5jY3iM9HEXDwvCkmSi9nNKn1QPDbIAMeQJxLJlOptMRLkeoD21WRbClPE5czx_JJ5MoVJp4T0lSl4pY3JRWoZSJxfJcROVQvVUJ6qRYnJ6nJR9yRPQEjWNSsFquFGoxqQ4WK5rp4bHu4r2AYNtnxpoFKrVtPudu5oYZqOdAZY4sVMfNXst-nuAZhLgxQbYuoR3IrUY9ce9UJYex1PCRLFLLh6bAD_ADe05NkAs4mAMr0CfX9Ji5jxMy4WC2Z5xUnsmdPbIBaORHOc98Y1lW5PG5lQDKI44sqTJ4CpNtljFtpPXPTJdLhRPSls7FpqvNjHej7LkPYqcsGfB2q2qTZteubblCPZinuLBluK9xzPepqAN7xG6QVuP6wRKspzo0qIBvaM44hhta3juUqtnqMpAVKl4UXmtKwpyezovwqYcGxqRnqa0ZYXW-Z6Ji6LWgysK8V2Aawtq3I2Ouo7CSe_5Mtxz5sLCSKVKkcr8Ux0H6CwqTduKL4ZrKro2F-N7MTue7skirLLnuUrWUpLFsXuenZHwAb3FKu76ZuQkscm-Guuwr5iumwWCZRUJ8Y0vGuse_66e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TrAnS0i2B-T3TEBPTvSZTZN_TwygzFja82TmdszIy0CqBCRjToBTSodV9EBIAYc9dPAY9mSWj6stdQYJsmBUyKzPj_Aic6tIBYBr8zdsjQd-csDFBrB1imA0CezYA-ylBrBIRa9jBDiK9rAAAiWyCkVclwCbOYhY9cqCLc-XYE1bNcvHTAVclo4vJcpw6IVc7FQ8ncvQtc-8lwBQCbE80AVcxAo42AC8_g68n8tcoRB83coCvxQ8t8j81cvXeY98wEP8__AClcz8kCp8z8sQeQRIFbCC48v4NcpXWAfnC8mPfMIwCjXAWACkVbC3ec66IURVdZDJU0IRMcMisAKgZ9bGcgmPDAIwSCvC_QGwAAYnTnDFhEQIJCEr7I4EgBksksK0QMgEqBPGpB4rAEvNqOBhwGEEK04tVG4rb34v8CEswFMr_2rzQKFPxzjMV1FylMTKstAI9K9JKx9Mq0zIDJzMkNZNDILIb1oCLJj2ov5zqChlq3BkUA61tLQPwOsHkOLw7zqD7MoF-JGBaJX2BPKzX1zJsMyL5wEpsEp3gHMtOCMB5PjLsudMUFdJjJGH5Iqob3spdP5JGDcIaswCauqq5PCEcvnJjzYAGoTJdMcvCDeFQFFKAA

Steps to Reproduce

  1. Use visualMap.piecewise using dedicated dimension to apply color and label on a scatter.
  2. 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.

mepcadol

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

093gszye

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").

相关问题