antvis / G2Plot

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

🐛 [BUG] 分面图子视图 type 为 bar 的时候坐标轴显示错误 #3675

Open yuanyongbin opened 1 year ago

yuanyongbin commented 1 year ago

🐛 Bug description [Please make everyone to understand it]

image

二维行列(矩形)分面 的坐标轴显示错误

📷 Step to reproduce

  1. 打开官网链接 二维行列(矩形)分面
  2. scatter 修改为 bar 即可复现 示例代码:
    
    import { Facet } from '@antv/g2plot';

fetch('https://gw.alipayobjects.com/os/antvdemo/assets/data/diamond.json') .then((res) => res.json()) .then((data) => { const plot = new Facet('container', { type: 'rect', fields: ['cut', 'clarity'], cols: 3, // 超过3个换行 padding: [0, 10, 10], appendPadding: 30, data, axes: {}, meta: { carat: { sync: true, }, price: { sync: true, }, cut: { // 设置 sync 同步之后,可以按照 'cut' 进行颜色映射分类 sync: true, }, }, eachView: (view, f) => { return { type: 'bar', options: { data: f.data, xField: 'carat', yField: 'price', colorField: 'cut', shape: 'circle', pointStyle: { fillOpacity: 0.3, stroke: null }, }, }; }, }); plot.render(); });



### 🏞 Expected result
正确的结果应该是第一列显示 Y 坐标轴, 最后一行显示 X 坐标轴。

### 🚑 Any additional [like screenshots]

* **G2Plot Version**:  2.4.25
* **Platform**:  谷歌浏览器