带有覆盖线标记的Vega-lite区域标记

时间:2020-01-07 23:23:26

标签: vega vega-lite

我对一个区域标记的line属性有一个奇怪的问题。我正在创建一个未堆积的面积图,其中绘制了多个面积路径。我想使用line属性添加一条叠加线。但是,当我这样做时,所有线都被分组在一起,并在所有区域标记的上方分层。 (请参见下图。)是否有人知道在标记或覆盖标记定义中将线与各自的区域标记分组的简便方法?Line marks layered on top of area marks.

这是我使用vega-lite4.0.0规范的数据输入和编码部分

 ..... "x": [
          2019,
          7,
          1
        ],
        "y": 267906,
        "z": "Total sum of Long Gun"
      }
    ]
  },
  "encoding": {
    "color": {
      "field": "z",
      "legend": {
        "labelLimit": 100,
        "legendY": 0,
        "orient": "right",
        "title": null
      },
      "scale": {},
      "type": "ordinal"
    },
    "x": {
      "axis": {
        "format": ""
      },
      "field": "x",
      "scale": {
        "padding": 0
      },
      "title": "",
      "type": "temporal"
    },
    "y": {
      "axis": {
        "format": "s"
      },
      "field": "y",
      "stack": null,
      "title": "",
      "type": "quantitative"
    }
  },
  "height": 345,
  "mark": {
    "color": "#0b84a5",
    "interpolate": "linear",
    "line": {
      "color": "black"
    },
    "type": "area"
  },
  "width": 755
}

0 个答案:

没有答案