Venugopal Madathil
Venugopal Madathil

Reputation: 2021

Disconnect points to plot overlay in Vega-lite / Vega

An example in vega-editor here

I don’t want dateTime 5 & dateTime 7 to be connected since they are not consecutive. Idea is to plot on overlay based on some condition and connect only when the count is >=5.

Has anyone tried this already?

Upvotes: 2

Views: 201

Answers (1)

jakevdp
jakevdp

Reputation: 86463

You can replace your filter statement:

{"filter": "datum.count >= 5"}

With a calculate statement that sets filtered values to null:

{"as": "count", "calculate": "if(datum.count >= 5, datum.count, null)"}

The result is here

enter image description here

Upvotes: 4

Related Questions