jiawulin001 commented on issue #16700: URL: https://github.com/apache/echarts/issues/16700#issuecomment-1110693178
### Problem locating In one sentence, Echarts is stacking value by index, not by name. Both 5.2.x and 5.3.x deal with stack data here and put it in `storage`: https://github.com/apache/echarts/blob/3961cefc0329cfa8782602fc2aea46cc76c3f50e/src/processor/dataStack.ts#L123-L139 However, `stackedDataRawIndex` is only decided by index of data. So if you have a hole in your stacked data, it will cause wrong stack. #### Why it works in 5.2.x The reason why no error occurs in 5.2.x is that it's using a completely new variable to store stack info instead of taking from `storage`. Check the variable `lastStackCoords` here: https://github.com/apache/echarts/blob/000ee7d2d1272cee96b0bd19bff9207301096c8d/src/layout/barGrid.ts#L445 This is no longer the case in 5.3.x. #### Why it doesn't work in 5.3.x Echarts now pick up stack data directly from `storage` and the 'stack-by-index' error is unveiled as long as there's a hole in stack data. Take a look at the new function in 5.3.x. https://github.com/apache/echarts/blob/3961cefc0329cfa8782602fc2aea46cc76c3f50e/src/layout/barGrid.ts#L465 So the 'stack-by-index' problem exists in **BOTH** version but the way to handle it changes in 5.3.x so the error pops up. ### Solution A good and general solution is not yet found by me, but I'll be looking for one and update it when I find it. -- 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]
