简体   繁体   中英

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?

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

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM