echarts柱状图表标题的位置竖立在Y轴上?

自己做的,第一个是我自己做的, 想要把标题改成第二的样式, 在线等, 比较急, 求帮忙

clipboard.png
怎么把Y轴的标题往左边调一点点
clipboard.png

想要移动的位置

clipboard.png
js

            let option = {
              color: ["#003366", "#006699", "#4cabce", "#e5323e"],
              title: {
                show: true,
                text: "电导率us/cm",
                // padding: [10],
                textStyle: {
                  fontWeight: "normal",
                  color: "#fff", // 标题颜色
                  fontSize: 14,
                },
                left: "center"
              },
              tooltip: {
                trigger: "axis",
                // 鼠标移动柱状图是提示文字
                show: true,
                axisPointer: {
                  type: "shadow"
                }
              },
              legend: {
                data: legend,
                textStyle: {
                  color: "#fff"
                }
              },
              toolbox: {
                show: true,
                orient: "vertical",
                left: "right",
                top: "center",
                feature: {
                  mark: {
                    show: true
                  },
                  dataView: {
                    show: true,
                    readOnly: false
                  },
                  magicType: {
                    show: true,
                    type: ["line", "bar", "stack", "tiled"]
                  },
                  restore: {
                    show: true
                  },
                  saveAsImage: {
                    show: true
                  }
                }
              },
              calculable: true,
              xAxis: [
                {
                  type: "category",
                  axisLabel: {
                    show: true,
                    textStyle: {
                      color: "#fff"
                    }
                  },
                  axisLine: {
                    lineStyle: {
                      color: "#fff"
                    }
                  },
                  axisTick: {
                    show: false
                  },
                  data: names
                }
              ],
              yAxis: [
                {
                  type: "value",
                  axisLine: {
                    lineStyle: {
                      color: "#fff"
                    }
                  },
                  splitLine: {
                    lineStyle: {
                      color: ["#fff"]
                    }
                  }
                }
              ],
              series: solumList
            };
阅读 18.2k
4 个回答

感觉用yAxisname合理一点 设置nameLocation:'center'

 yAxis: [
    {
        type: 'value',
        name: '电导率us/cm',
        nameLocation:'center',
        nameGap: 30,//与轴线间距
        nameTextStyle:{ //文字样式
          color: .
          fontSize: ..
          ...
        },
    },
]
新手上路,请多包涵

是要把第一张图的文字移动到第二张图的位置么?

文档中有个 grid 属性 你设置一下就好了

参考百度api 配置

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题