plainheart commented on issue #21182: URL: https://github.com/apache/echarts/issues/21182#issuecomment-3167326505
目前可以借助尚未公开的 API 通过如下方法来获取轴间隔: ```js // yAxisIndex 为 y 轴的索引,如果有多个 y 轴需要明确指定 function getYAxisScaleInterval(chartInstance, yAxisIndex) { return chartInstance .getModel() .getComponent('yAxis', yAxisIndex) .axis.scale.getInterval(); } ``` [参考示例](https://echarts.apache.org/examples/editor.html?c=line-simple&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AE2aMiAbVoBZGL1i0AKgFcqM2gHUqAlXIAWClQDEOEFQGVmphdFoBdEgF8-6cjnxFUpMpRqyAbowA2SrT2jrB4VEZUhLCi_MQegsJi1qEeFNR0_hDQynF2JLZ2ANwoKOFgAJLQLBx-_gAU9QCUCAB88bAA9J2wHIzQAsAAtrBCYIwkQ-QAwtqMHGAAdOUA8uBQ0PXupOGR0bEJHYdjIrBYHH3kiwBmHMNbsP5U0Kxg2kQA7LAOsM1tsAA_AH1CTMbSLPoDe4tABUMNgAGZYPCAIxUAAsTSacXQ-Q8tlxTRK6G6sBARmqsHoCguzzAsGcuDwYSYT1g2RqdUmMzmC2WVDAa0gMC2cUgYCebhxZCoGDARAABtMaRw6QyXMy8KyqOzqhE6kQACRIVgCgCaGpM2qqnIC9Sms3mYB4sAADE07Aq8vYiSgfgAmV1B30oa6WejCuCmsAWplWgJUG36u30XmVaB4cbQehUF2M_BVASylrbVVgGlwVNOqqZ_o5uKLaNSIsNbEeRsC6bDEAwOn1Wj5vAyQeF4sNxhM5bajvp22tkp2IA) -- 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-unsubscr...@echarts.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org