【发布时间】:2023-01-11 18:09:26
【问题描述】:
我有堆叠条形图的代码,来自Using Vega Lite to display already-aggregated data 它适用于维加编辑器
{
"data": {
"values": [
{"bin": "[-inf,8.0)", "bad_distr": 0.009210526315789473, "good_distr": 0.07763157894736843},
{"bin": "[8.0,14.0)", "bad_distr": 0.075, "good_distr": 0.21842105263157896},
{"bin": "[14.0,16.0)", "bad_distr": 0.009210526315789473, "good_distr": 0.05394736842105263},
{"bin": "[16.0,44.0)", "bad_distr": 0.16052631578947368, "good_distr": 0.3236842105263158},
{"bin": "[44.0,inf)", "bad_distr": 0.04078947368421053, "good_distr": 0.031578947368421054}
]
},
"transform": [
{"fold": ["bad_distr", "good_distr"], "as": ["bad", "good"]}
],
"mark": {"type": "bar"},
"encoding": {
"y": {"type": "ordinal", "field": "bin"},
"x": {"type": "quantitative", "field": "good"},
"color": {"type": "nominal", "field": "bad"}
}
}
情节很好
相同的数据,我在弹性数据库中,
相同的代码发出警告并且情节没有出现
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.4.json",
"title": {
"text": "Bin Plot",
"fontSize":14
},
"data": {
"url" : {
"index": "scorecard_bin_plot",
"body": {
"size":10000,
"_source": ["bin","good_distr","bad_distr"]
}
}
"format": {"property": "hits.hits"},
},
"transform": [
{"fold": ["_source.bad_distr", "_source.good_distr"], "as": ["bad", "good"]}
],
"mark": {"type": "bar"},
"encoding": {
"y": {"type": "ordinal", "field": "_source.bin"},
"x": {"type": "quantitative", "field": "good"},
"color": {"type": "nominal", "field": "bad"}
}
}
我不明白这个问题
使用弹性和 kibana 7.12.0
【问题讨论】:
-
你好 Mr.Negative Voting Genius,为什么这是反对票?这是一个糟糕的问题,还是您不知道答案? stack overflow是只给无所不知的人,还是只给想知道的人
-
你为什么删除你的评论?
-
你能告诉我你是如何在你的麋鹿集群中获得这些数据的吗?我正在尝试重现同样的问题
-
你解决了这个问题吗?如果你解决了,请分享给我!
标签: kibana elastic-stack vega-lite