apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.48k stars 19.62k forks source link

[Bug] candlestick chart encode option doesn't work for multi-dimension dataset on 'category xAxis' #18574

Closed sirokuma2023 closed 1 year ago

sirokuma2023 commented 1 year ago

Version

"echarts": "^5.4.2"

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=candlestick-simple&code=PYBwLglsB2AEC8sDeAoWsAmBDMWDOApmAFzJrqYQC2B0eUdpA2gOTZgEsA0sLot3XgGMANsEKCWACwgBzKQTxhJYgO6LlAXXIBfLuQAeAQQMQ8pVBVhgAniAKkWQnAVnAATjZa796GybMLcnRbe0cANywRAFdOH3JCdwhFZmCyKxC7B2EsaAwRDQghAGtuNPRaIWAMbMsM9ANHdk5fetgbZj57aElRcRbeGXkNFWB1JRZter1yzBwsVLbYJgBGAAYeACYN2ABmABYedZ5dgA4ptoB6S-WVrn2d3YBWE52ntc1W-uvlza5du57U4nXY8fb7T6zdA_Jigs5HF6wRH7TYXKxo2A6cjaHQAbiAA

Steps to Reproduce

The link as above.

Current Behavior

dimensions: ['date', 'open', 'close', 'highest', 'lowest']

'date' dimension of the data maps on 'open' dimension of candlestick series.

Expected Behavior

'date' dimension of the data should map as planned. It works fine on value xAxis,but consumes too many computational resources and the bar width also looks weird. Actually,I want to update next candlestick bar by clicking the chart,but it seems like it's only availible on bar series.Following link is bar series demo: https://echarts.apache.org/examples/zh/editor.html?c=bar-simple&code=PYBwLglsB2AEC8sDeAoWszGAG0iAXMgL4A0as2ApgOaXQAmhSp59AhmGwM6VhPnp6EALZ0uUaF0IBtAOQQGlAB6ySsWQDc22AK6VZAXXIt0SgIJKIU5AIwBPEJUKyAxhxrAATndnGy6OwsrJhNYHk8ISmtpW1R0eNhoNlFnAGVtfX8E-0dnACM2T1VbQQ42GRL46QAGNQAmAyzs2Gk6tQBmI2bGyroXYHonG2bTZwVBlSbsuxlNbT1DSqJbZfQjIgBuFBQtT1gALz3EYTsAYQALQrAAOlowAC1PAAoASi3d2HHlBFgAdi3DtcYE9XNgIC4ANaqWAAMx00BckBgsCeIEKyS4L2GsA-IGACjAAEloAAFCBKSjYH7SNGeDFAmEwnhgAAaalp9OAjOZAE0DFt0Lj8dAidAAOIReg_E4XK7XfrQDSUTxgABinmAwjJFOwIOokuheIJxO1lLe5AgMJRMsuKvlME4ClNutk-og9ENwtFzpeWLi8QA9AHYOxOAB9ACM1xAOi45ye0i-SgA1Mm1EmDOaEgquDhKNdsMBqE8k1n4ja5cyAPLgCRPf0JcKRaKVdANkbuwhJqbNMAOIayApFHvZUPlFqJxQptOfKcGHojeJsaAiDgSQgw7Q8VuwVbZLrxIhl5ZHjZAA

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

image

helgasoft commented 1 year ago

This is not-a-bug. Use one of:

but not both and not mixed. Series.data takes precedence over dataset. Demo Code

sirokuma2023 commented 1 year ago

This is not-a-bug. Use one of:

  • series.data with series.dimensions
  • dataset (eventually with series.encode)

but not both and not mixed. Series.data takes precedence over dataset. Demo Code

Thanks for the reply, but I need the xAxis type as category. Without type declaration, it will be set as value type . On value type, when the data size grows, the bar width doesn't change, which looks very weird.

helgasoft commented 1 year ago

On value type, when the data size grows, the bar width doesn't change, which looks very weird.

Let see that first (Minimal Reproduction) and we'll go from there.

sirokuma2023 commented 1 year ago

On value type, when the data size grows, the bar width doesn't change, which looks very weird.

Let see that first (Minimal Reproduction) and we'll go from there. demo Click the chart, it will update next candlestick. Like I said the width doesn't change when zooming.

helgasoft commented 1 year ago

Add data to the series instead of adding a new serie with a single candle - Demo Code

sirokuma2023 commented 1 year ago

Add data to the series instead of adding a new serie with a single candle - Demo Code

Thanks for your constant support, it may be my last resort to the issue. I thought about this way at the beginning, but it requires unnecessarily additional computaitional resources. However,the rendering speed is fast than I expected. Do you think it's a good idea to pull a request to add category sort feature on candlestick series or other cunstom series like the bar series have?

helgasoft commented 1 year ago

If you mean "sorting" like bar.realtimeSort, it could be done in the click processing, all data is available there. Adding a request for a "new feature" that can be easily written by the user himself will get no traction with developers here.

disclaimer opinions expressed in this post are strictly personal, as ECharts user, not a developer