Hello,
I want to show the latest state diagram for my customers. I have the following data
"values":
[
{"customer": "A", "@timestamp": 1527018117012, "state": "red"},
{„customer": "A", "@timestamp": 1523020495093, "state": "green"},
{"customer": "B", "@timestamp": 1523019277575, "state": "green"},
{"customer": "B", "@timestamp": 1523019247575, "state": "red"},
{"customer": "B", "@timestamp": 1523019147575, "state": "green"},
{"customer": "C", "@timestamp": 1523008092998, "state": "green"},
{"customer": "C", "@timestamp": 1523017219635, "state": " yellow"}
]
There should be only one state shown for each customer: the latest state according to the @timestamp. Currently my diagram shows all the states:
the current vega code is as following:
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"data": {
"values": [...]
},
"mark": "point",
"encoding": {
"y": {"field": "customer", "type": "nominal"},
"x": {"field": "state", "type": "nominal"}
}
}
How can I make Vega to show not all state of the customers but only the last state on the diagram? (it should be like this:
)