Vega visualizations not getting updated

Hi
In kibana dashboard, when we click on panel value in visualization it gets added to the filter and whole dashboard gets updated accordingly. But clicking on Vega visualization the value or condition is not getting added to the filter.

Any suggestions... It is the must condition in a dashboard.
sharing the screenshot...a) filter added from kibana viasualization, b) but not getting populated from vega visualization.
a)

b)

Below is my vega visualization script...

{
  $schema: https://vega.github.io/schema/vega-lite/v2.json
  title: {text: "Status Analysis", color:"#F70689" }
  data: {
    url: {
      %context%: true
      %timefield%: @timestamp
      index: dev-customer1-inc*
      body: {
     
        size: 10000,
        _source: ["@timestamp","result.number","result.state"]
      }

Any Help....
    }
    format: {property: "hits.hits"}
  }
  
  transform: [
    {calculate: "datum._source.result.state", as: "state"},
    {calculate: "datum._source.number", as: "number"},
     {calculate: "toDate(datum._source['@timestamp'])", as: "time"},
     {aggregate: [{op:"count",field:"number",as:"number" }]
     groupby:["state"]
     }
  ],
  
  mark: bar
  encoding: {
    x: {
      field: "state"
      type: "Nominal"
      axis: {title: "state"}
    }
    y: {
      field: "number"
      type: quantitative
      axis: {title: "No. of requests"}
    }
    color:{field: "number", scale:{range:["#A3F12C" ,"#CEEE9C", "#12BFEE", "#278902"]}}
     "tooltip": {"field": "number", "type": "quantitative"}
  }
   config: { axis:{ labelColor:"white", titleColor:"DB4E9B", labelAngle:360 }}
 
}

In Vega visualizations the filter is not automatically updated because Kibana doesn't know what a bar in your vega chart means. You can integrate vega visualizations with Kibana filters - check out this tutorial: https://www.elastic.co/guide/en/kibana/current/vega-tutorial.html

For your use case you need the kibanaAddFilter custom function (see here: https://www.elastic.co/guide/en/kibana/current/vega-reference.html#vega-expression-functions)

1 Like

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