【echarts】散点图写九宫格

这段代码展示了如何使用Echarts库创建一个散点图,并特别配置了x轴和y轴的刻度线颜色,每两个刻度线交替显示不同颜色,包括红色和灰色。此外,还设置了图表的提示框(aria)和数据标签(itemStyle)等功能,使得图表具有更好的视觉效果和交互性。
摘要由CSDN通过智能技术生成

实现效果

option = {
  xAxis: {
    min: 0.0,
    max: 9.0,
    interval: 1,
    splitLine: {
        show: true,
        lineStyle:{
          color: ['#DEDEDE','#DEDEDE','DEDEDE','red','#DEDEDE','#DEDEDE','red','#DEDEDE','#DEDEDE','red'],
          width: 1,
          type: 'solid'
      }
  }
  },
  yAxis: {
    min: 0.0,
    max: 9.0,
    interval: 1,
     splitLine: {
        show: true,
        lineStyle:{
           color: ['#DEDEDE','#DEDEDE','DEDEDE','red','#DEDEDE','#DEDEDE','red','#DEDEDE','#DEDEDE','red'],
           width: 1,
           type: 'solid'
      }
  }
  },

  aria: {
    show: true
  },
  series: [
    {
      
      symbolSize: 35,
      data: [
        [1.2, 8, '深井冰'],
        [4.1, 2.1, '秃头'],
        [5, 2, '骗你学'],
        [8, 8, '计算机']
      ],
      type: 'scatter',
      itemStyle: {
        normal: {
          color:'#61A8FF',
          label: {
            color: 'red',
            show: true,
            fontWeight:600,
            position: 'inside',
            
            formatter: function (params, ticket, callback) {
              var s = params.value[2];
              return s;
            }
          }
        }
      }
    }
  ]
};

https://github.com/PointWu/echarts-demoicon-default.png?t=M1L8https://github.com/PointWu/echarts-demo

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值