美文网首页
echarts的legend展示为空心圆

echarts的legend展示为空心圆

作者: 空格x | 来源:发表于2023-12-06 17:30 被阅读0次
    • 复制代码去Echarts的示例里粘贴进去即可看到效果
      效果图
    option = {
      title: {
        text: 'Stacked Line'
      },
      tooltip: {
        trigger: 'axis'
      },
      legend: {
        data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine'],
        itemWidth: 30,
        itemHeight: 30,
        itemStyle: {
            borderWidth:10 // 设置图例标记的边框宽度
          }
      },
      grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
      },
      toolbox: {
        feature: {
          saveAsImage: {}
        }
      },
      xAxis: {
        type: 'category',
        boundaryGap: false,
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
      },
      yAxis: {
        type: 'value'
      },
      series: [
        {
          name: 'Email',
          type: 'line',
          stack: 'Total',
          data: [120, 132, 101, 134, 90, 230, 210],
            symbol: "circle", // 实心圆
            lineStyle:{
              color: "pink",
            },
            itemStyle: {
              color: "#fff", //实圆的背景色
              borderWidth: 1,
              borderColor: "pink",
            },
        },
        {
          name: 'Union Ads',
          type: 'line',
          stack: 'Total',
          data: [220, 182, 191, 234, 290, 330, 310],
            symbol: "circle", // 实心圆
            lineStyle:{
              color: "#DC7828",
            },
            itemStyle: {
              color: "#fff", //实圆的背景色
              borderWidth: 1,
              borderColor: "#DC7828",
              
            },
        },
        {
          name: 'Video Ads',
          type: 'line',
          stack: 'Total',
          data: [150, 232, 201, 154, 190, 330, 410]
        }
      ]
    };
    

    相关文章

      网友评论

          本文标题:echarts的legend展示为空心圆

          本文链接:https://www.haomeiwen.com/subject/ffbjgdtx.html