-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
分面图在图例切换时,x轴无需隐藏,没有数据的分面隐藏 #6497
Comments
补充 空间复合的问题: 问题: 点击图例后,该显示的内容不显示,不该显示的显示
点击图例前截图 |
对于第一个问题,其实问题在于现在分面并没有提取出一个公共的坐标轴,在隐藏图例的时候只是单纯地对data做一个filter的处理,要满足自动调整的需求难度比较大,可以记一个点,这边是一些目前可能的优化方向,不知道能不能满足你的需求: {
type: 'facetRect',
width: 928,
height: 640,
paddingLeft: 60,
paddingBottom: 60,
data: [
{ series: '1', x: 10, y: 8.04 },
{ series: '1', x: 8, y: 6.95 },
{ series: '1', x: 13, y: 7.58 },
{ series: '1', x: 9, y: 8.81 },
{ series: '1', x: 11, y: 8.33 },
{ series: '1', x: 14, y: 9.96 },
{ series: '1', x: 6, y: 7.24 },
{ series: '1', x: '4', y: 4.26 },
{ series: '1', x: 12, y: 10.84 },
{ series: '1', x: 7, y: 4.81 },
{ series: '1', x: 5, y: 5.68 },
{ series: '2', x: 10, y: 9.14 },
{ series: '2', x: 8, y: 8.14 },
{ series: '2', x: 13, y: 8.74 },
{ series: '2', x: 9, y: 8.77 },
{ series: '2', x: 11, y: 9.26 },
{ series: '2', x: 14, y: 8.1 },
{ series: '2', x: 6, y: 6.13 },
{ series: '2', x: '4', y: 3.1 },
{ series: '2', x: 12, y: 9.13 },
{ series: '2', x: 7, y: 7.26 },
{ series: '2', x: 5, y: 4.74 },
{ series: '3', x: 10, y: 7.46 },
{ series: '3', x: 8, y: 6.77 },
{ series: '3', x: 13, y: 12.74 },
{ series: '3', x: 9, y: 7.11 },
{ series: '3', x: 11, y: 7.81 },
{ series: '3', x: 14, y: 8.84 },
{ series: '3', x: 6, y: 6.08 },
{ series: '3', x: '4', y: 5.39 },
{ series: '3', x: 12, y: 8.15 },
{ series: '3', x: 7, y: 6.42 },
{ series: '3', x: 5, y: 5.73 },
{ series: '4', x: 8, y: 6.58 },
{ series: '4', x: 8, y: 5.76 },
{ series: '4', x: 8, y: 7.71 },
{ series: '4', x: 8, y: 8.84 },
{ series: '4', x: 8, y: 8.47 },
{ series: '4', x: 8, y: 7.04 },
{ series: '4', x: 8, y: 5.25 },
{ series: '4', x: 19, y: 5.5 },
{ series: '4', x: 8, y: 5.56 },
{ series: '4', x: 8, y: 7.91 },
{ series: '4', x: 8, y: 6.89 },
],
encode: { y: 'series', color: 'series' },
children: [
{
type: 'point',
frame: false,
inset: 10,
margin: 5,
encode: { x: 'x', y: 'y', color: 'series' },
scale: {
y: {
type: 'linear',
clamp: true,
nice: true,
independent: true,
facet: false,
},
},
axis: {
x: ({ rowIndex, rowValuesLength }) =>
rowIndex === rowValuesLength - 1
? true
: {
title: false,
},
},
style: { stroke: '#000' },
viewStyle: { plotStroke: 'red', plotLineWidth: 2, plotOpacity: 0.5 },
},
],
}; |
不太满足,这个每个轴都显示出来数据可能对不上刻度,即使设置了对齐。我的建议是如果没有数据,可以直接把对应的分面给去掉,其他的分面进行拉伸 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题
分面图在图例切换时
操作流程:
渲染 - 点击图例去掉图例4的数据,再选中图例4的数据,y轴变化
测试数据
正常表现截图:
不达预期截图:
The text was updated successfully, but these errors were encountered: