首页 > 解决方案 > 这部分图表在 Vega-Lite 中叫什么?

问题描述

我试图摆脱 Vega-Lite 中图表框的右侧。我想一旦我弄清楚它叫什么,我就可以将颜色设置为白色。这不是域或网格,它是什么?对于奖励积分,我需要做什么才能让它消失?谢谢。

图表的图片,其中有问题的部分以红色圈出

标签: data-visualizationvega-litevega

解决方案


您突出显示的行称为stroke,您将在view配置中找到它,因为它是图表视图的一部分,并提供白色或透明的值。

请参阅以下代码段或编辑器参考:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Google's stock price over time.",
  "data": {"url": "data/stocks.csv"},
  "transform": [{"filter": "datum.symbol==='GOOG'"}],
  "mark": "line",
  "config": {"view": {"stroke": "transparent"}},
  "encoding": {
    "x": {"field": "date", "type": "temporal", "axis": {"grid": false}},
    "y": {"field": "price", "type": "quantitative", "axis": {"domain": false}}
  }
}

推荐阅读