2、echarts--series的基础配置

1,169 阅读1分钟

1、series -- 系列图标配置,图表类型

1、如果每一个对象,有name属性,legend可以不用写,lengend可以设置图例位置

2、stack -- 总量

3、symbol -- 线上的点

4、smooth -- 平滑曲线

5、lineStyle -- 曲线的宽度

6、color -- 设置我们线条的颜色 color: ["#1ab58e", "#fadcbb"],

注释:数组对应的每条线

series: [
          {
            name: "数据",
            type: "line",
            stack: "Total",
            symbol: "none", //线上原点
            smooth: true,
            lineStyle: {
              width: 1,
            },
            // showSymbol: true,
            label: {
              show: true,
              position: "top",
            },
            areaStyle: {
              opacity: 0.8,
              color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
                {
                  offset: 0,
                  color: "#eeb461",
                },
                {
                  offset: 1,
                  color: "#fcecd6",
                },
              ]),
            },
            itemStyle: {
              normal: {
                lineStyle: {
                  // width: 1, //线本身宽度
                  color: "#eeb461",
                },
              },
            },
            emphasis: {
              focus: "series",
            },
            data: [
              7500, 10000, 12000, 20000, 15000, 2200, 3020, 1810, 2340, 2100,
              2900, 1500,
            ],
          },
        ],