antvis / G2Plot

:dango: An interactive and responsive charting library based on G2.
https://g2plot.antv.antgroup.com
MIT License
2.55k stars 605 forks source link

🐛 [BUG]设置timeCat,brush-x无法使用 #3798

Open jinxinkai opened 2 months ago

jinxinkai commented 2 months ago

设置timeCat,brush-x无法使用

📷 Step to reproduce

import { Line } from '@antv/g2plot';

fetch('https://gw.alipayobjects.com/os/bmw-prod/1d565782-dde4-4bb6-8946-ea6a38ccf184.json')
  .then((res) => res.json())
  .then((data) => {
    const line = new Line('container', {
      data,
      padding: 'auto',
      xField: 'Date',
      yField: 'scales',
      xAxis: {
        type: 'timeCat',
      },
      interactions: [
        {
          type: 'brush-x'
        }
      ]
    });

    line.render();
  });