echarts如何优雅的去掉x轴y轴

option_column: {
  color: ['#9D509F'],
  grid: {
    left: '0',
    right: '0',
    bottom: '0',
    top: '0',
    // grid 区域是否包含坐标轴的刻度标签
    containLabel: false
  },
  xAxis: [
    {
      type: 'category',
      boundaryGap: false,
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
      show: true
    }
  ],
  yAxis: [
    {
      show: false,
      axisLine:{
            show:false
        },
        axisTick:{
            show:false
        },
        splitLine:{
            show:false
        }
    }
  ],
  series: [
    {
      type: 'line',
      stack: 'Total',
      smooth: true,
      lineStyle: {
        width: 0
      },
      showSymbol: false,
      areaStyle: {
        opacity: 0.8,
        color: '#9D509F'
      },
      emphasis: {
        focus: 'series'
      },
      data: [140, 232, 101, 264, 90, 340, 250]
    },
  ]
}

---------------------------------------------------------------------------------------------------------------------

option_column: {
  grid: {
    left: '0',
    right: '0',
    bottom: '0',
    top: '0',
    // grid 区域是否包含坐标轴的刻度标签
    containLabel: false
  },
  xAxis: {
    show: false,
    type: 'category',
    data: ['1','2','3','4','5','6','7','8','9','10','11','12','13','14']
  },
  yAxis: {
    show: false,
    type: 'value'
  },
  series: [
    {
      itemStyle: {
        color: '#2D8BD2'
      },
      data: [120, 160, 150, 80, 70, 110, 130,200,300,250,120,50,180,30],
      type: 'bar',
      // 柱状图宽度
      // barWidth: 10
    }
  ]
}

--------------------------------------------------------------------------------------------------------------------

option_column: {
  grid: {
    left: '0',
    right: '0',
    bottom: '0',
    top: '0',
    containLabel: false
  },
  xAxis: {
    show: false,
    type: 'value',
    boundaryGap: false
  },
  yAxis: {
    show: false,
    type: 'category',
    data: ['Brazil']
  },
  series: [
    {
      type: 'bar',
      data: [18203],
      stack: 'sear',
      itemStyle: {
        color: '#39C44A'
      },
      barWidth: 10
    },
    {
      type: 'bar',
      data: [6000],
      stack: 'sear',
      itemStyle: {
        color: '#EEEEEE'
      },
      barWidth: 10
    },
    {
      type: 'custom',
      stack: '总量',
      data: [100],
      renderItem: (params, api) => {
        const value = api.value(0)
        const endPoint = api.coord([value, 0])

        return {
          type: 'group',
          position: endPoint,
          children: [{
            type: 'path',
            shape: {
              d: 'M1024 255.996 511.971 767.909 0 255.996 1024 255.996z',
              x: 310,
              y: -20,
              width: 10,
              height: 10,
              layout: 'cover'
            },
            style: {
              fill: '#45c946'
            }
          }, {
            type: 'path',
            shape: {
              d: 'M0 767.909l512.029-511.913L1024 767.909 0 767.909z',
              x: 310,
              y: 10,
              width: 10,
              height: 10,
              layout: 'cover'
            },
            style: {
              fill: '#45c946'
            }
          }]
        }
      }
    }
  ]
}

 

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值