Sunburst Chart from aggregation

Hi,

I'm currently struggling a bit with Vega and how to prepare data for a Sunburst chart.
I have the following aggregation, which is the time spent on projects. From this I believe it should be pretty simple to draw a sunburst chart, but I cannot wrap my head around how to prepare data in Vega.

GET foo/_search
{
    "aggs": {
    "Project": { "terms": { "field": "ProjectName.keyword" },
    "aggs": {
        "days": { "sum": {"field": "days"} },
        "Phase": {
          "terms": { "field": "Phase.keyword"},
          "aggs": {
            "days": { "sum": { "field": "days" } },
            "Task": {
          "terms": { "field": "Task.keyword"},
          "aggs": {
            "days": { "sum": { "field": "days" } }
          }
        }
          }
        }
      }
    }
  },
  "size": 0,
  "query": {
    "match_all": {}
  }
}

my goal is to create something like this https://vega.github.io/vega/examples/sunburst/ where the center is the sum of all days spent on all projects (total in output) and then split up by days spent on each project, then on each phase per project,...

If you happen to have any hints, I would greatly appreciate them.

thanks, Bernie

So, I realized way too late that a sunburst chart is built-in in Kibana by adding layers to a piechart... no need to fiddle with Vega

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