# Interactive vega chart is not working in Kibana

**URL:** <https://discuss.elastic.co/t/interactive-vega-chart-is-not-working-in-kibana/196239>\
**Category:** Kibana\
**Created:** [August 22, 2019, 6:05am UTC](https://discuss.elastic.co/t/interactive-vega-chart-is-not-working-in-kibana/196239 "2019-08-22T06:05:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sagesh](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Sagesh](https://discuss.elastic.co/u/Sagesh)\
**Post date:** [August 22, 2019, 6:05am UTC](https://discuss.elastic.co/t/interactive-vega-chart-is-not-working-in-kibana/196239/1 "2019-08-22T06:05:04Z")

</div>

I created a Vega interactive chart in Kibana and it's not working as expected. The chart is getting rendered but it's not clickable.  
**Kibana version : 6.5**  
I tried the same code in vega editor and it's working fine there.  
Here is my code

```
{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.4.0.json",
  "title": "counts",
 "data": {
    "values": [
      {"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
      {"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
      {"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}
    ]
  },
  "selection": {
    "highlight": {"type": "single", "empty": "none", "on": "mouseover"},
    "select": {"type": "multi"}
  },
  "mark": {
    "type": "bar",
    "fill": "#4C78A8",
    "stroke": "black",
    "cursor": "pointer"
  },
  "encoding": {
    "x": {"field": "a", "type": "ordinal"},
    "y": {"field": "b", "type": "quantitative"},
    "fillOpacity": {
      "condition": {"selection": "select", "value": 1},
      "value": 0.3
    },
    "strokeWidth": {
      "condition": [
        {
          "test": {
            "and": [
              {"selection": "select"},
              "length(data(\"select_store\"))"
            ]
          },
          "value": 2
        },
        {"selection": "highlight", "value": 1}
      ],
      "value": 0
    }
  },
  "config": {
    "scale": {
      "bandPaddingInner": 0.2
    }
  }
}

```

Please let me know if i am missing anything.

Thanks,  
SK Nair

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [August 22, 2019, 4:55pm UTC](https://discuss.elastic.co/t/interactive-vega-chart-is-not-working-in-kibana/196239/2 "2019-08-22T16:55:00Z")

</div>

It is usually very difficult to debug Vega questions without having your data. To make it easier, please follow these steps to include data with your graph when posting:

- Reduce your data query to the smallest possible dataset, e.g. set the time range to 15 minutes. It will work as long as it is not empty and represents your data well enough.
- Open Browser Debugger (for Chrome, right click and click `Inspect` )
- Switch to the `Console` tab
- Copy the right command, paste it in the console at the `>` symbol and hit enter (check the `schema` in your graph to see if you use Vega or Vega-Lite)

```auto
JSON.stringify(VEGA_DEBUG.vega_spec) // <-- if you use Vega
JSON.stringify(VEGA_DEBUG.vegalite_spec) // <-- if you use Vega-Lite

```

- Copy the entire result string into your post, or if it is too big, attach it as a file.

# Useful debugging tips

You can use `VEGA_DEBUG` for more than just exporting raw code with data. See [debugging docs](https://vega.github.io/vega/docs/api/debugging/). Examlpes:

- `VEGA_DEBUG.view.data('mydatasource')` -- shows data of a specific data source after all transformations. In Vega, use the data source names. Vega Lite automatically creates them for you - to see which ones were created, see the `VEGA_DEBUG.vega_spec` data section.
- `VEGA_DEBUG.view.signal('mysignal')` -- shows the current value of a signal.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 19, 2019, 5:01pm UTC](https://discuss.elastic.co/t/interactive-vega-chart-is-not-working-in-kibana/196239/3 "2019-09-19T17:01:13Z")

</div>

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