J'essaie d'afficher une règle horizontale à une valeur constante dans Vega-Lite, sans succès. Voici le code (peut être collé en https://vega.github.io/editor/#/ ):
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"encoding": {
"x": {"field": "ts", "type": "temporal"},
"y": {"field": "a", "type": "quantitative"}
},
"layer": [
{
"data": {
"values": [
{"ts": "2021-11-26", "a": 0.16},
{"ts": "2021-11-28", "a": 0.12}
]
},
"mark": { "type": "point" }
},
{
"data": { "values": [] },
"mark": {"type": "rule", "color": "red"},
"encoding": {"y": {"datum": 0.15, "type": "quantitative"}}
}
]
}
Dans ce code, j'utilise une deuxième couche pour superposer une règle pour une valeur constante, mais elle ne s'affiche pas. Avez-vous une idée ?