antvis/G2

Do you want to work on this issue?

You can request for a bounty in order to promote it!

在S2单元格中绘制G2折线图,当单元格高度偏小时y坐标轴反转 #6290

wyh888 posted onGitHub

问题描述

在S2单元格中绘制G2折线图,当单元格高度偏小时y坐标轴反转,可查看在s2中提的issue:https://github.com/antvis/S2/issues/2773

image

重现链接

No response

重现步骤

  1. 在s2官网demohttps://s2.antv.antgroup.com/zh/examples/custom/custom-shape-and-chart#custom-g2-chart修改折线图配置如下:

      values: {
           type: 'line',
           autoFit: false,
           padding: 0,
           data: [
             { year: '1991', value: 3 },
             { year: '1992', value: 7 },
             { year: '1993', value: 3.5 },
             { year: '1994', value: 5 },
             { year: '1995', value: 14 },
             { year: '1996', value: 6 },
             { year: '1997', value: 7 },
             { year: '1998', value: 9 },
             { year: '1999', value: 13 },
           ],
           encode: {
             x: 'year',
             y: 'value',
             shape: 'smooth',
             color: '#1b6bba',
           },
           scale: {
             y: {
               nice: true,
               reverse: true,
             }
           },
           axis: false,
           labels: [],
    
         },
  2. 可修改dataCell的height为 100 与 30,进行对比:

<img width="405" alt="image" src="https://github.com/antvis/S2/assets/11677125/c73e03bd-08bb-43f2-b291-7a7554c00ff4">

预期行为

No response

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

<img width="708" alt="image" src="https://github.com/antvis/S2/assets/11677125/f068f30f-8699-400d-ab16-a2eae82c604c"> <img width="643" alt="image" src="https://github.com/antvis/S2/assets/11677125/5021d88b-82a9-4180-9f90-cb36a7cc380a">

补充说明(可选)

No response


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests