Vega-Lite / Kibana difference to manage JSON object

此生再无相见时 提交于 2021-01-29 07:16:01

问题


I am trying to use Vega in Kibana and I have trouble manage data that are sub-object within the data.

It is working fine with https://vega.github.io/editor/#/edited but when I do it with Kibana, it doesn't work.

Vega-editor:

Kibana:

I have tried a lot of things to access the typology, I am stuck now.

{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"title": "Test",
"datasets": {
    "stores": [
        {
            "storeId": "toto",
            "info": {
                "typology": "type1"
            }
        },
        {
            "storeId": "tata",
            "info": {
                "typology": "type1"
            }
        },
        {
            "storeId": "titi",
            "info": {
                "typology": "type2"
            }
        }
    ],
    "labelsTimelines": [
        {
            "storeId": "toto",
            "value": 1000
        },
        {
            "storeId": "tata",
            "value": 2234
        },
        {
            "storeId": "titi",
            "value": 3
        }
    ]
},
"data": {
    "name": "stores"
},
"transform": [
    {
        "lookup": "storeId",
        "from": {
            "data": {
                "name": "labelsTimelines"
            },
            "key": "storeId",
            "fields": [
                "value"
            ]
        }
    }
],
"mark": "bar",
"encoding": {
    "y": {
        "aggregate": "sum",
        "field": "value",
        "type": "quantitative"
    },
    "x": {
        "field": "info.typology",
        "type": "ordinal"
    }
}

Thanks in advance!

来源:https://stackoverflow.com/questions/64375357/vega-lite-kibana-difference-to-manage-json-object

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!