No Data from Vega Percentiles Histogram

1st Post from a newbie,

I'm trying to replicate something like the below graph using Vega. All I currently get is a labelled frame with no data.

The data is returned by Elasticsearch

     "aggregations" : {
        "cpu" : {
          "values" : {
            "1.0" : 0.004999999999999999,
            "5.0" : 0.006,
            "25.0" : 0.008,
            "50.0" : 0.03723989723277846,
            "75.0" : 0.06195735022948351,
            "95.0" : 0.39579361863807483,
            "99.0" : 0.7608407483968309
          }
        }
      }
My attempted Vega code
    {
      $schema: https://vega.github.io/schema/vega-lite/v2.json
      title: SLA percentile evaluation

      data: {
        url: {
          %context%: true
          %timefield%: @timestamp
          index: metricbeat-*
          body: {
            "size": 0,
            "_source": "system.cpu.total.norm.pct" ,
            "aggs":{
              "cpu":{
                "percentiles":{
                  "field":"system.cpu.total.norm.pct",
                  "percents":[1, 5, 25, 50, 75,90, 95, 99]
                }
              }
            }
          }
        }
        format: { property: "aggregations.cpu.values" }
      },
      "mark": {"type": "bar", "style": "box"},
      "encoding": {
        "y": {"field": "values", "type": "quantitative"},
        "x": {"field": "key", "type": "quantitative", axis: {title: "Percentiles", tickMinStep: 1}},
        "color": {"value": "steelblue"},
        "size": {"value": 11}
      }

    }

What am I missing ??

Many Thanks

The debug in case it is useful

`"{"$schema":"https://vega.github.io/schema/vega-lite/v2.json","title":"SLA percentile evaluation","data":{"format":{"property":"aggregations.cpu.values"},"values":{"took":160,"timed_out":false,"_shards":{"total":26,"successful":26,"skipped":0,"failed":0},"hits":{"total":{"value":10000,"relation":"gte"},"max_score":null,"hits":[]},"aggregations":{"cpu":{"values":{"1.0":0.005,"5.0":0.006,"25.0":0.021,"50.0":0.036000000000000004,"75.0":0.06133333333333333,"90.0":0.1862999999999999,"95.0":0.6206,"99.0":0.7144400000000001}}}}},"mark":{"type":"bar","style":"box"},"encoding":{"y":{"field":"values","type":"quantitative"},"x":{"field":"key","type":"quantitative","axis":{"title":"Percentiles","tickMinStep":1}},"color":{"value":"steelblue"}},"config":{"range":{"category":{"scheme":"elastic"}},"mark":{"color":"#54B399"}},"autosize":{"type":"fit","contains":"padding"}}"`

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