echarts的legend展示为空心圆

  • 复制代码去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]
    }
  ]
};
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容