You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/12/18 06:33:26 UTC
[GitHub] [echarts] helgasoft commented on issue #18071: "time" scale axis but ordered by "dataset". Is this possible somehow?
helgasoft commented on issue #18071:
URL: https://github.com/apache/echarts/issues/18071#issuecomment-1356694199
This is by design.
When xAxis is _type='time'_, **X axis values** are sorted automatically b/c they need to be in (time) order.
Result: "2022-12-07" shows after "2022-12-04" correctly.
When xAxis is _type='category'_, order does not matter and **X axis values** appear as they are in the dataset.
Result: "2022-12-07" shows **before** "2022-12-04", which is incorrect.
**Y values** ('amount') show always in their original dataset sequence. That's why after sorting the dataset with ```source: dataset.sort()```, we get a different polyline, even though the individual values remain the same.
[Demo Code](https://echarts.apache.org/examples/en/editor.html?c=line-simple&code=MYewdgzgLgBAJgQygiBTWBeGBtAUDHAIkSlUIBoZCEBbEAVzCkIF1z8iAmABk84FoAjIP7dBFKuLYdshHnyEjeEua3YFZ8gcNEBWFQGY1Mub20jBRyoQAsxjaYU6eK_dIdahA7gHYVANnsuMy9RO2s_d2CnC24VAA4gzRDBbX1rAE4kx20BTnDJOJZcFgBuXBAABygAS3AYLABvDgAPAEEWmogALhhmggIAekGoAE9K1F6AcmAkVABzEAAnUan1AbGJ6dqaVDWOAF910Y6u3sajjhIUdF68Ab6YCAYl4En4JBuoADpnpagABQAShgBw4UTQSxqqB6OEem3ehAANjUwGRQTBigdSkA)

--
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: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org