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

Open
#21,504 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #21505 by @SakshamSinghal20 — closed without merging
  • #21531 by @04cb — closed without merging

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript

Research direction

Start with the linked ECharts minimal reproduction and compare the two axisLabel configurations, first with height alone and then with backgroundColor. Trace how axisLabel.height affects the category-axis label layout, and verify the fix by confirming the 150px height takes effect without a background color while preserving the existing background-color case.

Written by the indexing model from the issue text.

Description

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

Dominant language
TypeScript
Stars
67.7k
Forks
19.9k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/echarts

All issues in apache/echarts

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.