Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vega lite 如何在vega lite中过滤数据?_Vega Lite_Vega - Fatal编程技术网

Vega lite 如何在vega lite中过滤数据?

Vega lite 如何在vega lite中过滤数据?,vega-lite,vega,Vega Lite,Vega,我有一个线图的代码,我不知道如何使用过滤器转换,我有一个层内的标记和编码,以使用绘图的工具提示 { "$schema": "https://vega.github.io/schema/vega-lite/v2.4.json", "title": "Dashboard", "data": { "url" : { "%context%&

我有一个线图的代码,我不知道如何使用过滤器转换,我有一个层内的标记和编码,以使用绘图的工具提示

{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.4.json",
  "title": "Dashboard",
  "data": {
    "url" : {
        "%context%": true,
        "index": "paytrans",
        "body": {
          "size":10000,
          "_source": ["Metrics","Value","ModelName"],
        }
      }  
      "format": {"property": "hits.hits"},
  }, 
  "layer": [
    {  
      "mark": {
        "type": "line",
        "point": true
      },
      "encoding": {
        "x": {"field": "_source.ModelName", 
              "type": "ordinal", 
              "title":"Models"
              "axis": {
                "labelAngle": 0
                }
              },
        "y": {"field": "_source.Value", "type": "quantitative", "title":"Metric Score"
          "scale": { "domain": [0.0, 1.0] }},
        "color": {"field": "_source.Metrics", "type": "nominal", "title":"Metrics"},
        "tooltip": [
          {"field": "_source.Metrics", "type": "nominal", "title":"Metric"},
          {"field": "_source.Value", "type": "quantitative", "title":"Value"}
        ]
      }
    }
  ]  
}

如果我加上

  "transform": [
   {
      "filter": "datum.Value <= 0.5"
    }
  ],
“转换”:[
{

“筛选”:“datum.Value您似乎没有名为
Value
的字段;您有名为
\u source.Value
的字段。因此,正确的筛选方法是:

“转换”:[
{
“过滤器”:“基准面”\u源值