antvis/G2

设置了limitInPlot:true,element中设置的label没有被隐藏 #3803

zailushang5011 posted onGitHub

y轴设置了最大值,并且设置了limitInPlot:true,element超出部分隐藏了,但是element中设置的label还会显示,期望label也被隐藏; <img width="644" alt="lALPJvuSydX1ZgPNAwrNBQg_1288_778" src="https://user-images.githubusercontent.com/57588659/153157187-b58edf1c-34c0-4697-9d92-620b6024aa20.png">


几个方案:

  1. 业务代码中去避开
  • label 显示到图形中间
  • 根据 label 回调决定是否显示 label
  1. G2 中处理
  • limitInPlot 对 label 也进行处理,但是会导致 label 显示一半,截断一半
  • 超出 limitInPlot 区域的 label 直接隐藏,需要梳理下是否会带来其他的问题
posted by hustcc about 3 years ago

提供一下复现代码地址,我设置了limitInPlot:true和scale max,结果label是隐藏的

posted by connono about 3 years ago

Fund this Issue

$0.00
Funded

Pull requests