Disconnect points to plot overlay in Vega-lite / Vega

徘徊边缘 提交于 2019-12-11 08:33:31

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/53840247/disconnect-points-to-plot-overlay-in-vega-lite-vega

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!