kibana 7.x Visiable Vega使用

一.数据

https://blog.csdn.net/u011311291/article/details/104762380

二.使用Vega构建视图

统计男人各个年龄段的人数

{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "title": "Event counts from all indexes",
  "data": {
    "url": {
      "index": "class_01*",
      "body": 
      {
      "query": 
  		{
			"term": {
		      "sex.keyword": {
		        "value": "man"
		      }
		    }
		},
      "aggs": 
        {"groupsex": 
          {"terms": 
            {"field": "age"}}}, "size": 0}
    },
    "format": {"property": "aggregations.groupsex.buckets"}
  },
  "mark": {
    "type": "line",
    "point": true,
    "tooltip": true
  },
  "encoding": {
    "x": {"field": "key", "type": "ordinal", "axis": {"title": "sadsd"}},
    "y": {
      "field": "doc_count",
      "type": "quantitative",
      "axis": {"title": "Document count"}
    },
    "tooltip": [
    {"field": "key", "type": "quantitative"},
    {"field": "doc_count", "type": "quantitative"}
    ]
  }
}

小贴士:
1.所有的查询语句都在data中,可以使用tooltip,当鼠标滑到数据点上的时候显示数据。
2.如果聚合语句出现多次聚合操作,可以Vega的表示可以参考:
https://blog.csdn.net/u011311291/article/details/104763647
具体Vega的使用方法:
https://vega.github.io/vega-lite/examples/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值