antvis / G2Plot

:dango: An interactive and responsive charting library based on G2.
https://g2plot.antv.antgroup.com
MIT License
2.55k stars 605 forks source link

🐛 [BUG] legend 的显示的数据条数不正确 #3736

Open mrsai opened 8 months ago

mrsai commented 8 months ago

https://g2plot.antv.antgroup.com/zh/examples/pie/donut/#statistics 在 该示例中,将某一数据的type文本加长 const data = [ { type: '分类分类分类分类', value: 27 }, { type: '分类二', value: 25 }, { type: '分类三', value: 18 }, { type: '分类四', value: 15 }, { type: '分类五', value: 10 }, { type: '其他', value: 5 }, ];

然后添加这个属性让其显示在顶部 legend:{ position:"top" },

拖动浏览器窗口大小,观察legend 表现,当宽度小到一定的值的时候,data 长度为本来为6,但是页面会显示为7,并且第一条数据渲染不出来。