Data values about time graph kibana vega, vega-lite

Hi all experts, I'm a beginner of this new techonolgy. I would like to use vega for display line graph that plot data values over time-series (timestamp). The goal is to represent how data values and not count of data change in the time. It's important that data is taken from the index and not imported as provided by vega library examples from json or csv. Thanks for the attention.
Data is a float variable like ANGLE that is modified in time.
below there's the starting point of the vega.
(As suggested by elastic web page I modify the index from _all to my_index but I would like to represent data in the y axis not document_count but a parametric field as Angle)
P.s. the timefield selected is correct because I insert as date field @timestamp and it's worked.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "title": "Event counts from all indexes",
  "data": {
    "url": {
      "%context%": true,
      "%timefield%": "@timestamp",
      "index": "my_index",
      "body": {
        "aggs": {
          "time_buckets": {
            "date_histogram": {
              "field": "@timestamp",
              "interval": {"%autointerval%": true},
              "extended_bounds": {
                "min": {"%timefilter%": "min"},
                "max": {"%timefilter%": "max"}
              },
              "min_doc_count": 0
            }
          }
        },
        "size": 0
      }
    },
    "format": {"property": "aggregations.time_buckets.buckets"}
  },
  "mark": "line",
  "encoding": {
    "x": {"field": "key", "type": "temporal", "axis": {"title": false}},
    "y": {
      "field": "doc_count",
      "type": "quantitative",
      "axis": {"title": "Document count"}
    }
  },
}```

The start looks good, just use your data field in here:

  "y": {
      "field": "doc_count",
      "type": "quantitative",

instead of doc_count. that you should show you the values of the field. There might be some tuning to be done in the time_buckets interval, but that depends on the usual interval between your events.

I've tryed but the system return an error like "infinite,infinite" so I belive the problem is the kind of aggregation that is not what I'm looking for because I want only to visualize data based on timestamp. So following a kibana tutorial on youtube I start testing query and then I've tryed to visualize data as a line.
But I got different error I don't understand why due to the fact it's very similar to the lineguide follow. The range let us to retrive all documents
Now system provide me this error:
url.%context% and url.%timefield% must not be used when url.body.query is set


        {
     $schema: https: //vega.github.io/schema/vega-lite/v4.json
            mark: point
           data: {
          url: {
          %context%: true
          %timefield%: @timestamp
          index: _all
          body: {
        size: 10, 
        _source: ["@timestamp","ANGLE"],
        query:{
             bool: {
              must: [{
                exists: {
                   field: "ANGLE"
                 }
        
            }],
            filter: [{
                range: {
                  ANGLE: {
                      gte: 1,
                      lte: 49
                  }
                }
            }]
          }
        },
      },
    }
    format: { property: "hits.hits" }
      },
         encoding: {
         x: { field: "@timestamp", type: "temporal" }
         y: { field: "ANGLE", type: "quantitative"  }
      }
    } 

If I remouve the url.content and timefield it provide me again the problem pf infinite defined above:
Infinite extent for field "ANGLE": [Infinity, -Infinity]

[quote="LombardoAndrea195, post:4, topic:272714"]
Infinite extent for field "ANGLE": [Infinity, -Infinity]

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