echarts修改X轴Y轴和折线的颜色-示例代码

 

<div id="cate" ref="cate"></div>
setCate() {
      this.cate = this.$echarts.init(this.$refs.cate);
      var option = {
        tooltip: {
          trigger: "item",
          formatter: "{a} <br/>{b} : {c}"
        },
        xAxis: {
          type: "category",
          axisLabel:{
            show:true,
            textStyle:{
              color:"#fff"
            }
          },
          data: ["06:00", "08:00", "10:00", "12:00", "14:00", "16:00", "18:00"]
        },
        yAxis: {
          type: "value",
          axisLabel:{//修改坐标系字体颜色
            show:true,
            textStyle:{
              color:"#fff"
            }
          },
        },
        series: [
          {
            name: "金额/元",
            data: [820, 932, 901, 434, 4290, 1330, 200],
            type: "line",
            itemStyle: {
              normal: {
                color: "#FFAA00", //改变折线点的颜色
                lineStyle: {
                  color: "#fff" //改变折线颜色
                }
              }
            }
          }
        ]
      };
      this.cate.setOption(option);
    }
  }

 

 

posted @ 2020-09-02 13:36  JackieDYH  阅读(48)  评论(0)    收藏  举报  来源