如何从 Vega Lite 图表中删除轴线

How can I remove Axis Lines from Vega Lite Chart

我想从下面的 vega-lite 图表中删除/隐藏轴线。我试过将颜色更改为空(如下所示)或其他颜色,但这不起作用。

https://vega.github.io/editor/#/gist/fc799bc9f7a8f28b8f1f2ec84673e965/VL 轴 lines.json

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "A simple bar chart with embedded data.",
  "data": {
    "values": [
      {"responseType": "Yes", "proportion": 28},
      {"responseType": "No", "proportion": 7}
    ]
  },
  "mark": "bar",
  "encoding": {
    "y": {
      "field": "responseType",
      "type": "nominal",
      "title": null,
      "axis": {"axisColor": null, "grid": false, "ticks": false}
    },
    "x": {
      "field": "proportion",
      "type": "quantitative",
      "title": "% of Responses",
      "axis": {"axisWidth": "100", "grid": false, "ticks": false}
    }
  }
}

domain 隐藏轴线,因此为 x 和 y 设置 "axis": {"domain": false, "grid": false, "ticks": false} 会生成此图表:

如果您还添加 "config": {"view": {"stroke": null}} 作为顶级 属性,您将摆脱灰色轮廓:

Open the Chart in the Vega Editor