echarts曲线图的比例宽度不一致?

echarts的横坐标的没有具体的标示, X坐标没有一个格子来提示, 下面有图具体说明
clipboard.png
以下是标准格式
clipboard.png

js

/* 蒸发 */
createChartSix() {
  this.$http
    .get(this.$api.dataChart)
    .then(rsp => {
      if (rsp.status == 200) {
        let resData = rsp.data.data.device_1;
        let key = "蒸发_1";
        let xAxisData = resData[key].names;
        let seriesData = resData[key].values;
        let yMin = Math.min.apply(null, seriesData);
        let yMax = Math.max.apply(null, seriesData);
        var home_echarts_evaporation = echarts.init(
          document.getElementById("home_echarts_evaporation")
        );
        var speed = {
          grid: {
            left: 60
          },
          xAxis: {
            type: "category",
            data: xAxisData,
            axisLabel: {
              show: true,
              textStyle: {
                color: "#fff"
              }
            },
            axisLabel: {
              show: true,
              textStyle: {
                color: "#fff"
              }
            },
            axisLine: {
              lineStyle: {
                color: "#285555"
              }
            }
          },
          yAxis: {
            type: "value",
            min: yMin - 5,
            max: yMax + 5,
            axisLine: {
              lineStyle: {
                color: "#275454"
              }
            },
            axisLabel: {
              show: true,
              textStyle: {
                color: "#fff"
              }
            },
            splitLine: {
              lineStyle: {
                color: ["#0a3435"]
              }
            }
          },
          lineStyle: {
            color: "#0066ff"
          },
          series: [
            {
              data: seriesData,
              type: "line",
              smooth: true
            }
          ]
        };
        var resize = {
          width: 415,
          height: 290
        };
        home_echarts_evaporation.resize(resize);
        home_echarts_evaporation.setOption(speed);
      } else {
        throw rsp.message;
      }
    })
    .catch(err => {
      console.log("createChartOne有异常", err);
    });
阅读 3.1k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题