yqtian-se commented on issue #21875: URL: https://github.com/apache/echarts/issues/21875#issuecomment-7271889154
> I don't think this counts as a bug. Real-time sorting is _"used for bar-racing effect"_, according to the [documentation](https://echarts.apache.org/en/option.html#series-bar.realtimeSort). For this reason, it's called **realtime** sort rather than just "sort". Sorting bars by value **on data change only** is the goal. It is not intended to function as a toggle switch. [Data Transform](https://echarts.apache.org/en/tutorial.html#Data%20Transform) could be used for on-demand data sorting. By the way, it's not that difficult to return to a non-sorted series - [Demo](https://echarts.apache.org/examples/en/editor.html?code=lZFPbxoxEMXv-ymeclmQLAK0KNWiHtJeW7VKolwQh9llgBGLjWwvYYX47hnvJlGSW3wa-82f3zxfX-MWJXlUW_IRTxK3IFzdO72ULY5UN3ylIle70p0QtxQROAZ4pjrKnlPmKDumDhKFA35ikT8KW0u5Qf6XVl5WKfrFvhaboj8SStdF_8lLSMGd23O-nGfuEMVZ7XHOgI1WFjij5nUscDPGxejr6fYkIT3H9sAF8g4x77X2k1ZR5I3zrY5YUaTihdFA7JF90JToG-5rA3uVCizeqtUWLXy_aIE11YFfuy2-TQ0mPwy-zwymNwazid6nS1yW2WWeZWruw5bRaGtEqXbhs7E6X3WdE0CeEVTk1UiL1G UJ4NOBq_SSqeUPyuCaOFg3tupMGgw7l_bt7_R1I03517k3OL_f5SN-v64Cmn6T4TzTcKJHow-8je2JJYI2JDZRMV7-R9lKqnaIrlvAedmIpRrO8hdZ-4amA-thprPxeDh_Bg&enc=deflate) Thanks for the explanation. I agree that Data Transform is the appropriate choice for sorting data on demand. but I feel that is separate from the behavior reported here. The issue is that enabling `realtimeSort` writes `categorySortInfo` to the category axis, but setting `realtimeSort` back to `false` does not remove that state. The axis therefore remains sorted even when no series on it has `realtimeSort` enabled. This retained state also affects other series sharing the same axis. Consequently, these two charts have the same public option but different results: 1. a chart updated from `realtimeSort: true` to `false`; 2. a fresh chart created directly with `realtimeSort: false`. The linked demo shows that an application can explicitly restore the category order, but that is a workaround for the retained axis state. If `realtimeSort: false` is intentionally defined as “stop future sorting but preserve the last sorted order”, then the current behavior may be intentional and that behavior should probably be documented. Otherwise, the sort state should be cleared when no bar series on the axis has `realtimeSort` enabled. Could a maintainer confirm which behavior is intended? Thank you very much. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
