Cannot create data tables in Vega plugin for Kibana v6.2

I need to create a data table which has values that need to be calculated using scripted aggregations.
As Kibana out of box visualization don't support such aggregations(I think), I was considering using Vega visualization for this using the v6.2 Kibana.

However, I am not able to find any documentation for creating data tables in Vega.
Any help would be really appreciated.

Sample query i am trying:

  "size": 0,
  "aggs": {
    "locales": {
      "terms": {
        "field": "locale.keyword"
      "aggs": {
        "search_exit": {
          "sum": {
            "field": "Search_Exit"
        "sessions": {
          "value_count": {
            "field": "session_id.keyword"
        "Session_Clickthrough_%": {
          "bucket_script": {
            "buckets_path": {
              "Searches": "search_exit",
              "Sessions": "sessions"
            "script": "params.Searches/params.Sessions*100"

In the above case, I would like to create a table with values like:

 Locale          Session_Clickthrough%               Metric_2           Metric_3
 en-US                     10%                        XX                  XX
 zh-cn                     30%                        XX                  XX

Basically, multiple columns calculating percentages need to be shown in a tabular format


@AshishAAB you can use Vega for this, but it won't be as easy as HTML. Vega has text mark, but you need to do all of the layout -- label positioning yourself, so it won't be trivial. You could make all columns the same width, or a fixed percentage of the graph's width, and use a scale to convert it - e.g. x: { scale: "xscale", value: "locale" }, and the xscale could be a band scale which will map "locale" string onto some X coordinate scaled to the full width of the screen.

Thanks @nyuriks for the suggestion!
I would try the text mark to create such tables

1 Like

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