这是我的 wandb vega。问题是,现在,很难将鼠标悬停在我的行上并显示工具提示。就像您必须将鼠标悬停在该行的确切像素上一样。如何使激活半径更大,以便在我大约位于线条点的顶部时显示我的工具提示?
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"description": "A plot for an arbitrary number of lines",
"data": {
"name": "wandb"
},
"transform": [
{"filter": {"field": "${field:lineVal}", "valid": true}},
{"filter": {"field": "${field:step}", "valid": true}}
],
"title": "${string:title}",
"layer": [
{
"selection": {
"grid": {
"type": "interval",
"bind": "scales"
}
},
"mark": {"type": "line", "strokeWidth": 5, "interpolate": "linear", "tooltip": true},
"encoding": {
"x":{
"field": "${field:step}",
"type": "quantitative",
"title": "${string:xname}"
},
"y": {
"field": "${field:lineVal}",
"title": "y",
"type": "quantitative"
},
"color": {
"type": "nominal",
"field": "${field:lineKey}"
},
"strokeDash": {
"type": "nominal",
"field": "name"
}
}
}
]
}
您尚未提供数据和架构,因此很难回答您的具体情况。但是,您应该能够调整 https://vega.github.io/vega-lite/examples/interactive_multi_line_pivot_tooltip.html 中的示例代码来实现您想要的。