antvis/G2




The issue has been closed
极坐标系自动调整大小 #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'],
},
},
};
}