echarts x-axis text is not fully displayed

1. xAxis.axisLabel property

By making the x-axis text slanted
axisLabel: {
interval:0,
rotate:40
}

//控制x轴
xAxis: [
  {
    type: 'category',
    //字体倾斜
    axisLabel: {
      interval:0,
      rotate:40
    },
    data: deptList
  }
]

When the text is too long, it can be displayed by adjusting the grid

grid: {
  y: 80,
   y2:140,
   x2: 140
 }

2. Call the formatter to display the text vertically

axisLabel: {
  interval: 0,
  formatter: function (value) {
    return value.split("").join("\n");
  }
}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326751286&siteId=291194637