简体   繁体   English

断开点以在Vega-lite / Vega中绘制叠加图

[英]Disconnect points to plot overlay in Vega-lite / Vega

An example in vega-editor here 这里是vega-editor的一个例子

I don't want dateTime 5 & dateTime 7 to be connected since they are not consecutive. 我不希望连接dateTime 5和dateTime 7,因为它们不是连续的。 Idea is to plot on overlay based on some condition and connect only when the count is >=5. 想法是根据某些条件绘制叠加图,并仅在计数> = 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: 使用calculate语句将筛选值设置为null:

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

The result is here 结果就在这里

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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