yqtian-se opened a new issue, #21858: URL: https://github.com/apache/echarts/issues/21858
### Version 6.1.0 (also current `master` 34f4d927e) ### Link to Minimal Reproduction https://echarts.apache.org/examples/en/editor.html?code=fZJBS8NAEIXv_RXvlgRCkxgqGqkgnlWQ3koP2zpN1mazYXcrxtL_7uzGitDiJSTzZr598za6d1J3mOMwAUQnlfDfFbaitZRyzcqubunhU9oKB7ihpwqRk4qiFE73Fa7yFGvtnFYVyhzHMERGEg8sPRW_Uw0pepUfZCLfBLwJJ7gpvAPL6CovZllRZPkNwwvmRiJapX-FWy_MzoUiZ6E8CZeBQV5fAJbX50IA-tW8EHj-eVxNjneTLEMB3k6JHYGXwqYRxsE22jgyUyy4ZJ0hoSx2RH3o4ayyMSbUorfQ21DWRtayEy0aknXjqoklt-B09d7FcYL5PdTw6PFTQ1Z-UXw4dbI7TjvxQeV5ElyV3hUDAtkKxfjxekUtZIe40-6JTE3JFM_aNXyz3npXk00xnMZ-jL_vFRvX437aGNo4tGJgX_94ZOElnBiPB_MvYvbEHsvg8Rs&enc=deflate ```js option = { animation: false, singleAxis: { type: 'time', top: 20, bottom: 30 }, series: [{ type: 'themeRiver', data: [ ['2015/11/08', 10, 'a'], ['2015/11/09', 15, 'a'], ['2015/11/10', 35, 'a'], ['2015/11/08', 35, 'b'], ['2015/11/09', 36, 'b'], ['2015/11/10', 20, 'b'] ] }] }; // 1 s: make the chart shorter. The streams keep the top/bottom gaps of the original height: setTimeout(() => myChart.resize({ height: 200 }), 1000); // 3 s: set the same option again (notMerge). Nothing changes, yet the streams jump to the correct layout: setTimeout(() => myChart.setOption(option, true), 3000); ``` ### Steps to Reproduce 1. Create the chart with the option above in a 240x390 container. 2. Call `myChart.resize({ width: 400, height: 300 })` (or resize the browser window when the container height is responsive). 3. Compare with a chart created directly at 400x300. Setting the same option again with `notMerge: true` also fixes the layout. ### Current Behavior After the resize, the streams are laid out with the top and bottom gaps of the *initial* size. For example, when a 240x390 chart is resized to 400x300, the streams are squeezed or shifted instead of filling the area like a fresh 400x300 chart. `myChart.getOption().series[0].boundaryGap` also returns pixel numbers instead of the default `['10%', '10%']` (`[34, 34]` for the 240x390 chart, before and after the resize). A `setOption` that only changes the size of the `singleAxis` (`top`, `bottom`, `left` or `right`) shows the same problem. ### Expected Behavior The layout after `resize()` is the same as a fresh chart at the final size, and `boundaryGap` in the option is left unchanged. ### Environment - OS: any (also reproduced with the SVG renderer in Node.js SSR) - Browser: any - Framework: none ### Any additional comments? Cause: `themeRiverLayout` gets the array with `seriesModel.get('boundaryGap')` and then resolves the percentages in place (`boundaryGap[0] = parsePercent(boundaryGap[0], rect.height)`). This overwrites the option array, so every later layout reuses the pixel values from the first one. Copying the array before resolving fixes it; I can send a PR. -- 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]
