# Vega pie properties error converting github example to Kibana vega using a query with agg

**URL:** https://discuss.elastic.co/t/vega-pie-properties-error-converting-github-example-to-kibana-vega-using-a-query-with-agg/340181
**Category:** Kibana
**Tags:** vega
**Created:** [August 5, 2023, 5:17pm UTC](https://discuss.elastic.co/t/vega-pie-properties-error-converting-github-example-to-kibana-vega-using-a-query-with-agg/340181 "2023-08-05T17:17:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![carnealse](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carnealse/32/124350_2.png) [@carnealse](https://discuss.elastic.co/u/carnealse)
#### Post date: [August 5, 2023, 5:17pm UTC](https://discuss.elastic.co/t/vega-pie-properties-error-converting-github-example-to-kibana-vega-using-a-query-with-agg/340181/1 "2023-08-05T17:17:47Z")

</div>

I am getting this error

```auto
Invalid specification {...}
Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat"

```

I was using the pie chart from the github examples and using the kibana sample data logs. I made a range query for the last 90 days and an agg for doc count of the source and destination doc counts by terms.  
I tried to convert the pie chart that works from the github examples for vega but as a newbie to vega I am missing something here, since a relative 1 for 1 swap between example and test does not work:

```auto
{
  $schema: https://vega.github.io/schema/vega-lite/v5.json
  description: A basic donut chart example
  width: 500
  height: 500
  autosize: none

  signals: [
    name: startAngle, value: -1.55
    name: endAngle, value: 1.55
    name: padAngle, value: 0.01
    name: innerRadius, value: 190
    name: cornerRadius, value: 0
    name: sort, value: true
  ],

  data: {
    name: query,
    url: {
      index: kibana_sample_data_logs
      body: {
        query: {
          range: {
            "@timestamp": {
              gte: "now-30d",
              lte: "now"
            }
          }
        },
        aggs: {
          test: {
            terms: {
              field: "geo.srcdest",
              order: {
                "_key": "asc"
              }
            }
          }
        }
      }
    }
  },

  transform: [
    {
      type: "pie",
      field: "doc_count",
      startAngle: {signal: "startAngle"},
      endAngle: {signal: "endAngle"},
      sort: {signal: "sort"}
    }
  ],

  scales: [
    {
      name: "color",
      type: "ordinal",
      domain: {data: "query", field: "geo.srcdest"},
      range: {scheme: "category20"}
    }
  ],

  marks: [
    {
      type: arc,
      from: {data: "table"},
      encode: {
        enter: {
          fill: {scale: "color", field: "geo.srcdest"},
          x: {signal: "width / 2"},
          y: {signal: "height / 2"}
        },
        update: {
          startAngle: {field: "startAngle"},
          endAngle: {field: "endAngle"},
          padAngle: {signal: "padAngle"},
          innerRadius: {signal: "innerRadius"},
          outerRadius: {signal: "width / 2"},
          cornerRadius: {signal: "cornerRadius"}
        }
      }
    }
  ]
}

```

---

<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 2, 2023, 5:18pm UTC](https://discuss.elastic.co/t/vega-pie-properties-error-converting-github-example-to-kibana-vega-using-a-query-with-agg/340181/2 "2023-09-02T17:18:23Z")

</div>

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