echarts [Bug] yAxis.nameTextStyle.fontSize and xAxis.nameTextStyle.fontSize not working

bqf10yzr  于 5个月前  发布在  Echarts
关注(0)|答案(1)|浏览(52)

Version

5.4.1

https://echarts.apache.org/examples/zh/editor.html?code=PYBwLglsB2AEC8sDeAoWsDGwA2wBOAXLANoBEAxAMyUCcAHACIBCpAugDRqxjA6QhFU6dGDwQA5uICmhWKQCGADwgBnUp2GwlqgArAI0MDMFdNYAJ4gpRUioAW8gCbAA7qVOwAvl08bY4sUdBXy5FAEFlFSJiIWELKxsMeSNxfHN1D0dk-WjSAFkYdTkAFQBXKSLSAHUpR0riu1LKgDExSoBlZI7S6DY_dGh5AFspYqlFMHaLbGtkD3QAMxhJiAAvWcoABg9vdE8OLnMI1WjYkUtZ0gA3eWxy9z2D9BUZCCkokjPYQZGbQBe3QClxoB-6MAd6kZMwXGwAI3keHBwhheCqEEcYDsNgAbJsAKTw9BZMA5EgARk27FgAFYAEzkqmbMmwagAFnJtAZ1AZVLprB8PM8QA&_source=echarts-doc-preview

Steps to Reproduce

option = {
  color: ["#3398DB"],
  tooltip: {
    trigger: "axis",
    axisPointer: {
      type: "shadow"
    }
  },
  grid: {},
  xAxis: [{
    type: "category",
    data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
    nameTextStyle: {
      fontSize: 30
    }
  }],
  yAxis: [{
    type: "value",
    nameTextStyle: {
      fontSize: 30
    }
  }],
  series: [{
    name: "直接访问",
    type: "bar",
    barWidth: "60%",
    data: [10, 52, 200, 334, 390, 330, 220]
  }]
}

Current Behavior

The configuration of yAxis.nameTextStyle.fontSize and xAxis.nameTextStyle.fontSize is not working, whether it is given a larger value or a smaller value.

Expected Behavior

yAxis.nameTextStyle.fontSize and xAxis.nameTextStyle.fontSize can work

Environment

- OS:windows 11
- Browser:chrome latest
- Framework:js

Any additional comments?

No response

h7wcgrx3

h7wcgrx31#

It works, your code is just missing X-axis name - like name: 'myXaxis'
If you want to change X-axis labels, then the setting is axisLabel.fontSize

Demo Code

相关问题