Skip to content

[Bug] ’width‘ is not work in axis‘s nameTextStyle #16940

@kitee0325

Description

@kitee0325

Version

5.3.2

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=bar-y-category

Steps to Reproduce

jump to the link, use this option

option = {
  title: {
    text: 'World Population'
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow'
    }
  },
  legend: {},
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: {
    type: 'value',
    boundaryGap: [0, 0.01],
    nameLocation: 'center',
    name: 'sdfasdfsadfsddsfasdf',
    nameTextStyle: {
      height: 20,
      width: 500,
      overflow: 'truncate',
      borderColor: '#000',
      borderWidth: 1
    }
  },
  yAxis: {
    type: 'category',
    data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World']
  },
  series: [
    {
      name: '2011',
      type: 'bar',
      data: [18203, 23489, 29034, 104970, 131744, 630230]
    },
    {
      name: '2012',
      type: 'bar',
      data: [19325, 23438, 31000, 121594, 134141, 681807]
    }
  ]
};

Current Behavior

axisName's width is not change
image

Expected Behavior

change axisName's width, enable overflow

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions