VegaLite 中用于标记的线宽:规则

Line thickness in VegaLite for mark: rule

我有 this plot and I am trying to make the dashed line really thin compared to the others, but can't quite figure it out. I've tried size on the actual mark-rule encoding part, as well as strokeWidth in the config (which at least the vega example here 建议是我想要的)但没有快乐。我错过了什么?

非整数笔划宽度似乎在规则标记中四舍五入;然而,线标记不是这种情况。如果你用这个替换你的 rule 层,它似乎会做你想做的事:


    {
      "data": {
        "values": [
          {"date": "2019-12-10", "metric": 100},
          {"date": "2019-12-16", "metric": 100}
        ]
      },
      "mark": {"type": "line", "strokeWidth": 0.5, "color": "black"},
      "encoding": {
        "x": {"field": "date", "type": "temporal", "timeUnit": "monthdate"},
        "y": {"field": "metric", "type": "quantitative"}
      }
    }

这是结果 (vega editor):