antvis/G2

极坐标系自动调整大小 #5048

pearmini posted onGitHub

  • 问题:仪表盘没有充满图表
  • 出现原因:非完整的几坐标系没有调整大小
  • 实现思路:对于 polar 等 radial 坐标系,transform 里面计算角度,然后增加一个 scale 变换。
  • 版本:5.0.7

<img src="https://github.com/antvis/G2/assets/49330279/93e7400b-5eb0-4c0e-baec-bcd04c72811d" width=640 />

export function gaugeCustomColor(): G2Spec {
  return {
    type: 'gauge',
    data: {
      value: {
        target: 120,
        total: 400,
        name: 'score',
        thresholds: [100, 200, 400],
      },
    },
    scale: {
      color: {
        range: ['#F4664A', '#FAAD14', 'green'],
      },
    },
  };
}

image image image image image image

posted by hustcc almost 2 years ago
posted by pearmini 11 months ago

@pearmini 这个问题之前做了一半,coordinate 的 revert 没有办法处理,看看是否能解决。

posted by hustcc 9 months ago

@hustcc 好

posted by pearmini 9 months ago

Fund this Issue

$0.00
Funded

Pull requests