Hi all,
I'm in trouble to binding this data to Vega group bar chart:
#data1:
[
{
"key": "morning",
"from": 0,
"to": 11,
"doc_count": 125,
"orders ": {
"value": 56
},
"customers": {
"value": 47
}
},
{
"key": "afternoon",
"from": 13,
"to": 18,
"doc_count": 25,
"orders": {
"value": 13
},
"customers": {
"value": 21
}
},
{
"key": "evening",
"from": 18,
"to": 24,
"doc_count": 35,
"orders": {
"value": 19
},
"customers": {
"value": 23
}
}
]
If following vega sample I need to transform data to the following :
#data2:
[ { "key": "morning", "from": 0, "to": 11, "doc_count": 125, "position": 0, "value": 56, "name": "orders" }, { "key": "morning", "from": 0, "to": 11, "doc_count": 125, "position": 1, "value": 47, "name": "customers" }, { "key": "afternoon", "from": 13, "to": 18, "doc_count": 25, "position": 0, "value": 13, "name": "orders" }, { "key": "afternoon", "from": 13, "to": 18, "doc_count": 25, "position": 0, "value": 21, "name": "customers" }, { "key": "evening", "from": 18, "to": 24, "doc_count": 35, "position": 0, "value": 19, "name": "orders" }, { "key": "evening", "from": 18, "to": 24, "doc_count": 35, "position": 1, "value": 23, "name": "customers" } ]
Is it possible to use vega transform to convert the data #1 to data #2 ?
Or is there any other implemetation which can binding this data to group bar chart with VEGA ?
Anyway, I can display this data by using the build-in chart in kibana easily but I want to use VEGA for the UI customization.
Thanks,
Thomas.