我想将计数的值以简单的方式添加到工具提示中到Vega中的简单直方图图中?
就像这样:
{
"data": {
"url": "data/movies.json"
},
"mark": "bar",
"encoding": {
"tooltip": [
{
"field": "Count of Records",
"type": "quantitative"
}
],
"x": {
"bin": true,
"field": "IMDB_Rating",
"type": "quantitative"
},
"y": {
"aggregate": "count",
"type": "quantitative"
}
}
}在工具提示编码中似乎没有引用聚合y编码的方法。
发布于 2019-08-26 18:05:00
工具提示和任何其他编码一样,都是编码;您可以向工具提示传递与y编码相同的参数:
{
"data": {
"url": "data/movies.json"
},
"mark": "bar",
"encoding": {
"tooltip": [
{
"aggregate": "count",
"type": "quantitative"
}
],
"x": {
"bin": true,
"field": "IMDB_Rating",
"type": "quantitative"
},
"y": {
"aggregate": "count",
"type": "quantitative"
}
}
}在行动中看到它这里。
https://stackoverflow.com/questions/57662025
复制相似问题