echarts线的颜色修改

//左上温度湿度Echarts
    initlt() {
      this.chartsL_t = this.$echarts.init(this.$refs.chartsl_t);
      this.optionlt = {
        tooltip: {
          trigger: "axis",
        },
        legend: {
          data: ["温度1", "温度2"],
          textStyle: {
            color: "#ffffff",
          },
        },
        grid: {
          left: "1%",
          right: "1%",
          bottom: "1%",
          top: "20%",
          containLabel: true,
        },
        xAxis: {
          type: "category",
          data: this.ltx,
          axisLabel: {
            interval: 0,
            rotate: 40, //x轴文字倾斜
          },
          scale: false,
          axisLine: {
            lineStyle: {
              color: "rgba(234, 233, 233, 1)", //x轴颜色
            },
          },
          axisTick: {
            show: false, //是否显示刻度
          },
        },
        yAxis: [
          {
            type: "value",
            show: true,
            name: "温度(℃)",
            min: -10,
            max: 40,
            interval: 10,
            splitLine: {
              show: true,
              lineStyle: {
                color: "rgba(234, 233, 233, 1)", //分割线颜色
              },
            },
            nameTextStyle: {
              color: "#ccc", //y轴name颜色
              align: "right",
            },
            axisLine: {
              show: true, //是否显示坐标轴线
              lineStyle: {
                color: "rgba(234, 233, 233, 1)", //坐标轴线颜色
              },
            },
            axisTick: {
              show: false, //轴线刻度
            },
            axisLabel: {
              formatter: "{value}",
            },
          },
          {
            type: "value",
            show: true,
            name: "湿度(%)",
            min: 0,
            max: 100,
            interval: 20,
            splitLine: {
              show: true,
              lineStyle: {
                color: "rgba(234, 233, 233, 1)", //分割线颜色
              },
            },
            nameTextStyle: {
              color: "rgba(234, 233, 233, 1)", //y轴name颜色
              align: "left",
            },
            axisLine: {
              show: true, //是否显示坐标轴线
              lineStyle: {
                color: "rgba(234, 233, 233, 1)", //坐标轴线颜色
              },
            },
            axisTick: {
              show: false,
            },
            axisLabel: {
              formatter: "{value}",
            },
          },
        ],
        series: [
          {
            name: "湿度",
            type: "line",
            stack: "Total",
            data: this.ltw1,
            smooth: true,
            showSymbol: false, //小圆点隐藏
            itemStyle: {
              color: "#da4061", //线的颜色以及头部显示的颜色
            },
          },
          {
            name: "温度",
            data: this.ltw2,
            type: "line",
            smooth: true,
            showSymbol: false, //小圆点隐藏
            itemStyle: {
              color: "#1bc1f0", //线的颜色以及头部显示的颜色
            },
          },
        ],
      };
      this.chartsL_t.setOption(this.optionlt);
    },
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值