我正在使用kibana中的vega来可视化数据。现在我想画一个漏斗图,但它没有任何这样的例子。

谢谢你的帮助
发布于 2020-02-28 15:04:33
您可以使用stack: "center"的条形图在Vega-Lite中创建漏斗图。例如(vega editor):
{
"data": {
"values": [
{"Pipeline": "Consultation", "Count": 140000},
{"Pipeline": "Prospect", "Count": 120000},
{"Pipeline": "Qualified", "Count": 100000},
{"Pipeline": "Negotiation", "Count": 80000},
{"Pipeline": "Prototype", "Count": 60000},
{"Pipeline": "Closing", "Count": 40000},
{"Pipeline": "Won", "Count": 20000},
{"Pipeline": "Finalized", "Count": 10000}
]
},
"encoding": {"y": {"field": "Pipeline", "type": "nominal", "sort": null}},
"layer": [
{
"mark": "bar",
"encoding": {
"color": {"field": "Pipeline", "type": "nominal", "legend": null},
"x": {"field": "Count", "type": "quantitative", "stack": "center"}
}
},
{
"mark": "text",
"encoding": {"text": {"field": "Count", "type": "quantitative"}}
}
],
"width": 500
}

https://stackoverflow.com/questions/60444288
复制相似问题