Open yuanyongbin opened 1 year ago
二维行列(矩形)分面 的坐标轴显示错误
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**: 谷歌浏览器
🐛 Bug description [Please make everyone to understand it]
二维行列(矩形)分面 的坐标轴显示错误
📷 Step to reproduce
scatter
修改为bar
即可复现 示例代码: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(); });