Vega with conditionnal coloring depending on filter

Hi there!

I'm not an expert in Vega language but I would like to make a visualization which background color would depend on the filter in the dashboard.

Let's say I have a Vega with a text and a background color. If a user choose a filter in the dashboard, I would like to change the background color.

I don't know if it's possible with that kind of visualization?

Best regards,

For instance, I have this markdown code :

{
  "$schema": "https://vega.github.io/schema/vega/v3.json",
  "autosize": "true"
  "background": "#234990",
  "padding": 5,
  "marks": [
    {
      "type": "text",
      "encode": {
        "update": {
          "text":     { "value": "MY TEXT" },
          "align":    { "value": "center"},
          "baseline": { "value": "line-bottom"},
          "stroke":   { "value": "#FFFFFF" },
          "angle":    { "value": 0 },
          "x":        { "signal": "width/2" },
          "y":        { "signal": "height/2.3" }
        }
      }
    }
  ]
}

It would be great I could change the background color depending on what filters I have on my dashboard level.

Would you think it's possible?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.