im unable to get my Vega to show smth?
this the o/p using Vega-Lite 2.0
this is the o/p using Vega 4.0
{
"$schema": "https://vega.github.io/schema/vega/v4.json",
"data": {
"url": {
"%context%": true,
"%timefield%": "DateTime",
"index": "nsew*",
"body": {
"size": 10000,
"_source": ["Current_Platform_Name", "Align_Distance_To_Go_mm","Train_Type"]
}
},
"format": {"property": "hits.hits"}
},
"transform": [
{"filter": {"field": "datum._source['Align_Distance_To_Go_mm']", "range": [-300, 300]}},
{
"joinaggregate": [{
"op": "count",
"field": "datum.Align_Distance_To_Go_mm",
"as": "count_all_Dist"
}],
"groupby": ["Current_Platform_Name"]
},
{
"joinaggregate": [{
"op": "count",
"field": "datum.Align_Distance_To_Go_mm",
"as": "count_within_Dist"
}],
"groupby": ["Current_Platform_Name"]
},
{
"calculate": " (datum.count_within_Dist/datum.count_all_Dist)*100 ",
"as": "Percent_Compliance"
}
],
"layer": [
{
"mark": "bar",
"height": {"step": 5},
"encoding": {
"x": {
"field": "Percent_Compliance",
"type": "quantitative",
"axis": {"title": "Percent_Compliance"}
},
"y": {
"field": "_source.Current_Platform_Name",
"type": "nominal",
"axis": {"title": "Platform Name"}
},
"color": {
"field": "_source.Current_Platform_Name",
"type": "nominal",
"legend": {"title": "Platform Legend"}
},
"shape": {"field": "_source.Current_Platform_Name", "type": "nominal"}
}
}
]
}
here is my code. i dont get why its not working out.
i do prefer using Vega 4.3.0 - so i do seek your advice from the Vega approach instead. Thanks