[Bug] The `axisLabel.height` property does not take effect when no background color is set

未关闭
#21,504 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

  • #21505 来自 @SakshamSinghal20 —— 已关闭,未合并
  • #21531 来自 @04cb —— 已关闭,未合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
typescript

调研方向

从链接的 ECharts 最小复现开始,比较两个 axisLabel 配置,先仅使用 height,然后再使用 backgroundColor。跟踪 axisLabel.height 如何影响类目轴标签布局,并通过确认在没有背景色的情况下 150px 高度生效,同时保留现有的背景色案例来验证修复。

由索引模型根据 Issue 内容生成。

描述

bug en pending
Version

6.0.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/editor.html?code=fZC9TsMwEMf3PsVJCHmJ1DShiAYx8CEmkJBA6oA6OLHlWAQ7chxohPIKrAzMrJ3YeRs-3oKzk7aiSF3uzuff3_c_69JKreAIngYAmS60SeCW7MTx5ODshMwC7FqtCyvLxCN4NFIIjhihc1kRRwC48kpLZd1FxyHZlByxKqdMPxLfbDG2TiKMZEj6en6MahzriQ1xRi0X2jT9HABGLXUWLzUJgNzU3KUpZ_6U1y6dG-nSNbU-1arbY-nzgqa8WLsEyLkUuU1gNA6XHMBwCCnN7oTRtWKn3ccQg3N6wm3SRf94s2WHB1qgzb98xY3k_wSK3jvB1-v75_Pb9-Lj52WxWrx_LKVm1cJ6KpnNsb0f7m5-0SgMYBwFEIVYxPEehomvMERROFsbGrSHvw&_source=echarts-doc-preview&enc=deflate

Steps to Reproduce
  1. Create a regular bar chart
  2. Set the height of the axis label without setting the background color
Current Behavior
option = {
  color: ["#3398DB"],
  tooltip: {
    trigger: "axis",
    axisPointer: {
      type: "shadow"
    }
  },
  grid: {},
  xAxis: [{
    type: "category",
    data: ["Mo", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
    axisLabel: {
      height: 150
    }
  }],
  yAxis: [{
    type: "value"
  }],
  series: [{
    name: "直接访问",
    type: "bar",
    barWidth: "60%",
    data: [10, 52, 200, 334, 390, 330, 220]
  }]
}
Image
Expected Behavior
option = {
  color: ["#3398DB"],
  tooltip: {
    trigger: "axis",
    axisPointer: {
      type: "shadow"
    }
  },
  grid: {},
  xAxis: [{
    type: "category",
    data: ["Mo", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
    axisLabel: {
      height: 150,
      backgroundColor: 'red'
    }
  }],
  yAxis: [{
    type: "value"
  }],
  series: [{
    name: "直接访问",
    type: "bar",
    barWidth: "60%",
    data: [10, 52, 200, 334, 390, 330, 220]
  }]
}
Image
Environment
- OS: mac os
- Browser: chrome
Any additional comments?

No response

主要语言
TypeScript
星标
67.7k
派生
19.9k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/echarts 的其他 Issue

查看 apache/echarts 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。