You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "xu1132 (via GitHub)" <gi...@apache.org> on 2025/08/08 06:04:52 UTC
[I] [Feature] 能不能添加一个获取y轴单位刻度值标签的api [echarts]
xu1132 opened a new issue, #21182:
URL: https://github.com/apache/echarts/issues/21182
### What problem does this feature solve?
没有获取单位刻度值标签的接口,用起来真麻烦
### What does the proposed API look like?
1
--
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.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
Re: [I] [Feature] 能不能添加一个获取y轴单位刻度值标签的api [echarts]
Posted by "plainheart (via GitHub)" <gi...@apache.org>.
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-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
Re: [I] [Feature] 能不能添加一个获取y轴单位刻度值标签的api [echarts]
Posted by "plainheart (via GitHub)" <gi...@apache.org>.
plainheart closed issue #21182: [Feature] 能不能添加一个获取y轴单位刻度值标签的api
URL: https://github.com/apache/echarts/issues/21182
--
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
Re: [I] [Feature] 能不能添加一个获取y轴单位刻度值标签的api [echarts]
Posted by "xu1132 (via GitHub)" <gi...@apache.org>.
xu1132 commented on issue #21182:
URL: https://github.com/apache/echarts/issues/21182#issuecomment-3167216151
我需要拿到y轴的单位值,比如上图中间隔也就是interval的值是200,我希望通过一个便捷的方式拿到这个值。我在定位markPoint时需要以interval为参考,比如让markPoint位于柱状图上方比柱子高半个单位,就需要知道interval的值是多少。当然最后我用symbolOffset来设置markPoint的偏移量间接实现了这一效果。还有之前我在试图在图表上方留白20%的时候,也就是将上限提高20%即y轴最大刻度值提高20%,如果能拿到单位刻度值实现起来就会容易的多,总之我觉得开发一个获取y轴单位刻度值的方法是很有必要的。
徐壹
***@***.***
------------------ 原始邮件 ------------------
发件人: "Zhongxiang ***@***.***>;
发送时间: 2025年8月8日(星期五) 下午3:54
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [apache/echarts] [Feature] 能不能添加一个获取y轴单位刻度值标签的api (Issue #21182)
plainheart left a comment (apache/echarts#21182)
没太明白,具体希望是什么样的接口?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
--
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
Re: [I] [Feature] 能不能添加一个获取y轴单位刻度值标签的api [echarts]
Posted by "plainheart (via GitHub)" <gi...@apache.org>.
plainheart commented on issue #21182:
URL: https://github.com/apache/echarts/issues/21182#issuecomment-3166909749
没太明白,具体希望是什么样的接口?
--
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