antvis/G2

【v5】padding auto 时 Y 轴 label false,图显示异常 #5337

Deathsteps posted onGitHub

问题描述

padding auto 时,Y 轴 label 关闭后,左右 padding 异常宽 <img width="999" alt="image" src="https://github.com/antvis/G2/assets/1549118/c9f946c6-1e38-4991-928b-7b65013b1877">

期望结果

显示合理的 padding( i.e. 默认值?)

如何重现

官方代码修改

/**
 * A recreation of this demo: https://observablehq.com/@d3/bar-chart
 */
import { Chart } from '@antv/g2';

const chart = new Chart({
  container: 'container',
  theme: 'classic',
  autoFit: true,
  padding: 'auto',
});

chart
  .interval()
  .data({
    type: 'fetch',
    value:
      'https://gw.alipayobjects.com/os/bmw-prod/fb9db6b7-23a5-4c23-bbef-c54a55fee580.csv',
  })
  .encode('x', 'letter')
  .encode('y', 'frequency')
  .axis("y", {
    "label": false
  });

chart.render();

额外信息

  • G2 5.0.16 版本

Fund this Issue

$0.00
Funded

Pull requests