# Vega-lite Concatenating views with 'concat' error message: "Invalid spec"

**URL:** https://discuss.elastic.co/t/vega-lite-concatenating-views-with-concat-error-message-invalid-spec/207668
**Category:** Kibana
**Tags:** vega
**Created:** [November 13, 2019, 9:45am UTC](https://discuss.elastic.co/t/vega-lite-concatenating-views-with-concat-error-message-invalid-spec/207668 "2019-11-13T09:45:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Josip\_Cagalj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/josip_cagalj/32/42899_2.png) [@Josip\_Cagalj](https://discuss.elastic.co/u/Josip_Cagalj)
#### Post date: [November 13, 2019, 9:45am UTC](https://discuss.elastic.co/t/vega-lite-concatenating-views-with-concat-error-message-invalid-spec/207668/1 "2019-11-13T09:45:33Z")

</div>

Hi,  
I'm trying to use vega-lite visualization in Kibana using concatenating views, specifically `concat`. Basically I have four numbers which I've calculated using various aggregations from elasticsearch which I want to display as plain text but with corresponding labels. This is what I get using Vega editor:

 ![1](https://us1.discourse-cdn.com/elastic/original/3X/e/1/e1008ad1defeb0a9166ec451d6f29aaaf726bdf6.png)  
And the code:  
{  
"$schema": "[https://vega.github.io/schema/vega-lite/v2.6.0.json](https://vega.github.io/schema/vega-lite/v2.6.0.json)",  
"data": {  
"values": [{"In": "40,005.65", "Out": "37,344.35", "Diff": "2,661.30", "Perc": "93.35 %"}]  
},  
"background": "red",

```
  "config": {
    "style": {
      "cell": {
        "stroke": "transparent"
      }
    },
    "text": {
      "fontSize": 48,
      "fontWeight": 500,
      "color": "yellow",
      "align": "left"
    }
  },

  "columns": 4,

  "spacing": 0,

  "concat": [
    {
      "mark": {
        "type": "text",
        "dx": 0,
        "text": "In",
        "fontSize": 24,
        "fontWeight": "normal"
      }
    },    
    {
      "mark": {
        "type": "text",
        "dx": 30,
        "text": "Out",
        "fontSize": 24,
        "fontWeight": "normal"
      }
    },    
    {
      "mark": {
        "type": "text",
        "dx": 30,
        "text": "Difference",
        "fontSize": 24,
        "fontWeight": "normal"
      }
    },    
    {
      "mark": {
        "type": "text",
        "dx": 30,
        "text": "Percentage",
        "fontSize": 24,
        "fontWeight": "normal"
      }
    },    
    {
      "mark": {
        "type": "text"
      },
      "encoding": {
        "text": {
          "field": "In", 
          "type": "ordinal"
        }
      }
    },    
    {
      "mark": {
        "type": "text",
        "dx": 30
      },
      "encoding": {
        "text": {
          "field": "Out", 
          "type": "ordinal"
        }
      }
    },
    {
      "mark": {
        "type": "text",
        "dx": 30
      },
      "encoding": {
        "text": {
          "field": "Diff", 
          "type": "ordinal"
        }
      }
    },
    {
      "mark": {
        "type": "text",
        "dx": 30
      },
      "encoding": {
        "text": {
          "field": "Perc", 
          "type": "ordinal"
        }
      }
    }
  ]
}

```

But when I switch to Kibana UI I'm getting an error "Invalid spec". The query part is returning the data OK that's not the problem, if I use `hconcat` instead of `concat` everything displays but I want labels to be above the data.  
The code from Kibana is:  
{  
"$schema": "[https://vega.github.io/schema/vega-lite/v2.6.0.json](https://vega.github.io/schema/vega-lite/v2.6.0.json)",  
"title": "",  
"data": {...},

```
  "transform": [
    { "calculate": "datum.pay_in_sum_amount.value_as_string", "as": "In" },
    { "calculate": "datum.pay_out_sum_amount.sum_amount.value_as_string", "as": "Out" },
    { "calculate": "datum.ggr.value_as_string", "as": "Diff" },
    { "calculate": "datum.rtp.value_as_string + ' %'", "as": "Perc" }
  ],

  "background": "red",

  "autosize": {"type": "fit"},
  
  "config": {
    "style": {
      "cell": {
        "stroke": "transparent"
      }
    },
    "text": {
      "fontSize": 48,
      "fontStyle": "Bold",
      "color": "yellow",
      "align": "left"
    }
  },

  "columns": 4,

  "spacing": 0,

  "concat": [
    {
      "mark": {
        "type": "text",
        "dx": 0,
        "text": "In",
        "fontSize": 24
      }
    },    
    {
      "mark": {
        "type": "text",
        "dx": 30,
        "text": "Out",
        "fontSize": 24
      }
    },    
    {
      "mark": {
        "type": "text",
        "dx": 30,
        "text": "Difference",
        "fontSize": 24
      }
    },    
    {
      "mark": {
        "type": "text",
        "dx": 30,
        "text": "Percentage",
        "fontSize": 24
      }
    },    
    {
      "mark": {
        "type": "text"
      },
      "encoding": {
        "text": {
          "field": "In", 
          "type": "ordinal"
        }
      }
    },    
    {
      "mark": {
        "type": "text",
        "dx": 30
      },
      "encoding": {
        "text": {
          "field": "Out", 
          "type": "ordinal"
        }
      }
    },
    {
      "mark": {
        "type": "text",
        "dx": 30
      },
      "encoding": {
        "text": {
          "field": "Diff", 
          "type": "ordinal"
        }
      }
    },
    {
      "mark": {
        "type": "text",
        "dx": 30
      },
      "encoding": {
        "text": {
          "field": "Perc", 
          "type": "ordinal"
        }
      }
    }
  ]
}
```

---

<div class="post-metadata">

### Author: ![Josip\_Cagalj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/josip_cagalj/32/42899_2.png) [@Josip\_Cagalj](https://discuss.elastic.co/u/Josip_Cagalj)
#### Post date: [November 13, 2019, 12:13pm UTC](https://discuss.elastic.co/t/vega-lite-concatenating-views-with-concat-error-message-invalid-spec/207668/2 "2019-11-13T12:13:04Z")

</div>

Ok, so to reply to myself, I thing the problem is in vega-lite version. Kibana supports v2.6.0. and `concat` property was introduced in v3 I think.  
I'm running Kibana in AWS, is there a way to force vega-lite v3 ?

---

<div class="post-metadata">

### Author: ![azasypkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/azasypkin/32/42216_2.png) [@azasypkin](https://discuss.elastic.co/u/azasypkin)
#### Post date: [November 13, 2019, 12:24pm UTC](https://discuss.elastic.co/t/vega-lite-concatenating-views-with-concat-error-message-invalid-spec/207668/3 "2019-11-13T12:24:31Z")

</div>

> [@Josip\_Cagalj](#):
>
> I'm running Kibana in AWS, is there a way to force vega-lite v3 ?

Hi @Josip_Cagalj,

Unfortunately it's not possible right now. But I've been told that adding support for vega-lite v3 is planned in the scope of [this issue](https://github.com/elastic/kibana/issues/31413). Feel free to follow it to track progress.

Best,  
Oleg

---

<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: [December 11, 2019, 12:24pm UTC](https://discuss.elastic.co/t/vega-lite-concatenating-views-with-concat-error-message-invalid-spec/207668/4 "2019-12-11T12:24:33Z")

</div>

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