echarts鼠标滚动缩放改变日期

代码区域

var colorList = {
        type: 'linear',
        x: 0,
        y: 0,
        x2: 0,
        y2: 1,
        colorStops: [{
          offset: 0,
          color: '#06DBF5' // 0% 处的颜色
        }, {
          offset: 1,
          color: '#00d386' // 100% 处的颜色
        }],
        globalCoord: false // 缺省为 false
      }
      var specialColor = {
        type: 'linear',
        x: 0,
        y: 0,
        x2: 0,
        y2: 1,
        colorStops: [{
          offset: 0,
          color: '#FEDD3D' // 0% 处的颜色
        }, {
          offset: 1,
          color: '#F99901' // 100% 处的颜色
        }],
        globalCoord: false // 缺省为 false
      }
      var option = {
        // backgroundColor: '#12234F',
        "title": {
          "text": "30天能耗数据监测",
          "left": "center",
          "y": "0",
          "textStyle": {
            "color": "#fff"
          }
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: { // 坐标轴指示器,坐标轴触发有效
            type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
          }
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '14%',
          top:'15%',
          containLabel: true
        },
        xAxis: {
          type: 'category',
          data: ['10/01','10/02','10/03','10/04','10/05','10/06','10/07','10/08','10/09','10/10','10/11','10/12','10/13','10/14','10/15','10/16','10/17','10/18','10/19','10/20','10/21','10/22'],
          // axisTick: {
          //     alignWithLabel: true
          // }
          axisLine: {
            lineStyle: {
              color: 'white'

            }
          },
          axisLabel: {
            // interval: 0,
            // rotate: 40,
            textStyle: {
              fontFamily: 'Microsoft YaHei'
            }
          },
        },

        yAxis: {
          type: 'value',
          axisLine: {
            show: false,
            lineStyle: {
              color: 'white'
            }

          },
          splitLine: {
            show: true,
            lineStyle: {
              color: 'rgba(255,255,255,0.3)'
            }
          },
          axisLabel: {}
        },
        "dataZoom": [{
          "show": false, //关闭自动展示数据
          "height": 30,
          "xAxisIndex": [
            0
          ],
          bottom:'8%',
          "start": 10,
          "end": 80,
          handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
          handleSize: '110%',
          handleStyle:{
            color:"#d3dee5",

          },
          textStyle:{
            color:"#fff"},
          borderColor:"#90979c"


        }, {
          "type": "inside",
          "show": true,
          "height": 15,
          "start": 1,
          "end": 35
        }],
        series: [{
          name: '',
          type: 'bar',
          barWidth: '60%',
          // label:{
          //     normal:{
          //         show:true,
          //         formatter: function(v) {
          //             var val = v.data;
          //             if (val === 0) {
          //                 return '';
          //             }
          //             return val;
          //         },
          //         color: '#fff'
          //     }
          // },
          itemStyle: {
            color: function (params) {
              /* if (params.name == '建许路口') {
                   return specialColor;
               } else {
                   return colorList;
               }*/
              return colorList;
            },
            //barBorderRadius: 15,
          },
          emphasis: {
            itemStyle: {
              color: specialColor
            }

          },
          data: [12000, 10000, 8000, 8000, 6000, 6000, 6000, 5377, 2000, 1760, 1325, 1200, 1000, 1000, 1000,12000, 10000, 8000, 8000, 6000, 6000, 6000]
        }]
      };

      var app = {
        currentIndex: -1,
      };
     

鼠标滚动放大
在这里插入图片描述
鼠标滚动缩小
在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Ciito

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值