AntV F2 折线图横向滚动问题

试着用AntV F2做个支持滚动的横屏折线图,看了下官方示例,设置横屏后,操作手势没有变过来,还是竖屏状态的左右方向,不知道有没有大佬踩过坑。
我是直接在官方示例横屏图基础上改的

fetch('https://gw.alipayobjects.com/os/antfincdn/Jpuku6k%24q%24/linear-pan.json')
  .then(res => res.json())
  .then(data => {
    const originDates = [];
  const originSteps = [];
  const firstDayArr = [];
  data.forEach(function (obj) {
    if (obj.date >= '2018-05-01') {
      originDates.push(obj.date);
      originSteps.push(obj.steps);
    }

    if (obj.first) {
      firstDayArr.push(obj);
    }
  });

    const chart = new F2.Chart({
      id: 'container',
      pixelRatio: window.devicePixelRatio
    });
   chart.source(data, {
       release: {
         min: 1970,
         max: 2010
      }
    });
    chart.line().position('release*count');
    chart.point().position('release*count').style({
       lineWidth: 1,
       stroke: '#fff'
    });
    // 定义进度条
    chart.scrollBar({
     mode: 'x',
     xStyle: {
        backgroundColor: 'transparent',
        fillerColor: 'transparent',
         offsetY: -2
      }
    });
   chart.interaction('pan');
    chart.render();
  })
阅读 1.7k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题