# Vega visualisation using href to open an url does not seem to work

**URL:** <https://forum.opensearch.org/t/vega-visualisation-using-href-to-open-an-url-does-not-seem-to-work/25700>\
**Category:** OpenSearch Dashboards\
**Tags:** troubleshoot\
**Created:** [July 10, 2025, 4:12pm UTC](https://forum.opensearch.org/t/vega-visualisation-using-href-to-open-an-url-does-not-seem-to-work/25700 "2025-07-10T16:12:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harold](https://avatars.discourse-cdn.com/v4/letter/h/8491ac/32.png) [@harold](https://forum.opensearch.org/u/harold)\
**Post date:** [July 10, 2025, 4:12pm UTC](https://forum.opensearch.org/t/vega-visualisation-using-href-to-open-an-url-does-not-seem-to-work/25700/1 "2025-07-10T16:12:21Z")

</div>

I created a vega visualisation that shows a simple rectangle and a text. If you click on it, I would like it to open another tab or window to an URL specified by the HREF. But this does not work, here is my Vega JSON.

```auto
{
  "$schema": "https://vega.github.io/schema/vega/v5.json",
  "description": "A green box with 'Offline Systems' and a number '0'.",
  "padding": 0,
  
  "config": {
    "font": "Inter"
  },
    "data": [
  ],
  "marks": [
    {
      "type": "rect",
      
      "encode": {
        "enter": {
            "x": {"value": 0},
            "y": {"value": 0},
            "width": {"signal": "width"},
            "height": {"signal": "height"},
            "cornerRadius": {"value": 0}
        },
        "update": {
          "href": "https://www.google.com",
          "fill": {"value": "#3273a8"},
        }
      }
    },
    {
      "type": "text",
      "encode": {
          "enter": {
              "href": {"value": "https://axsguard.cloud"},
              "text": {"value": "Show Offline Systems"},
              "x": {"signal": "width/2"},
              "y": {"signal": "height/2"},
              "align": {"value": "center"},
              "baseline": {"value": "middle"},
              "fill": {"value": "white"},
              "fontSize": {"value": 17},
              "fontWeight": {"value": "bold"}
          }
      }
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![Leeroy](https://avatars.discourse-cdn.com/v4/letter/l/eb9ed0/32.png) [@Leeroy](https://forum.opensearch.org/u/Leeroy)\
**Post date:** [July 14, 2025, 3:27pm UTC](https://forum.opensearch.org/t/vega-visualisation-using-href-to-open-an-url-does-not-seem-to-work/25700/2 "2025-07-14T15:27:46Z")

</div>

Hey Harold,

I have tested the above and it works, in order to get it to work I had to add the following setting to my opensearch dashboards configuration.

```auto
vis_type_vega.enableExternalUrls: true

```

These two settings are also required,

```auto
data_source.enabled: true
vis_type_vega.enabled: true

```

But I imagine you’ve already set these in order to enable using Vega as per - [Vega - OpenSearch Documentation](https://docs.opensearch.org/docs/latest/dashboards/visualize/vega/) .

Leeroy.
