G2Plot icon indicating copy to clipboard operation
G2Plot copied to clipboard

🥰 [FEATURE] 支持折线图的坐标轴逆序

Open webproblem opened this issue 2 years ago • 1 comments

#3252

这个 issues 中提过这个问题,但是给的答案只是用于柱状图,在折线图中不会生效,希望能支持折线图的坐标轴逆序。

webproblem avatar Nov 13 '23 03:11 webproblem

已经有解决方案了,折线图的坐标轴逆序可以用面积图来模拟

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

fetch('https://gw.alipayobjects.com/os/bmw-prod/360c3eae-0c73-46f0-a982-4746a6095010.json')
  .then((res) => res.json())
  .then((data) => {
    const area = new Area('container', {
      data,
      xField: 'timePeriod',
      yField: 'value',
      xAxis: {
        position: 'top',
      },
      smooth: true,
      coordinate: [{ type: 'reflectY' }],
      areaStyle: {
        fill: ''
      },
    });
    area.render();
  });


webproblem avatar Nov 13 '23 03:11 webproblem