Vega Infinite extent for field error

Hi,

I am creating scatter plot and its working fine until I choose time range from calendar which does not contain data. I have data until May 2021 so when I go for 1 Year its fine, but when I choose last 4 months, it gives me error - for X axis Infinite extent for field "time": [Infinity, -Infinity] and also error for Y axis Infinite extent for field "Kilometers": [Infinity, -Infinity].

Its probably problem in date conversation but why its working for periods containing data and why is it giving me error for kilometers as well. Any help here please?

Elastic query returns timefield in unix time.

Thank you

(I have same problem also with line chart in vega)

{
  $schema: https://vega.github.io/schema/vega-lite/v2.6.0.json
  data: {
    url: {
      %context%: true
      %timefield%: timefield
      index: indextrains
      body: {
        size: 10000
        _source: [
          timefield
          km
        ]
      }
    }
    format: {
      property: hits.hits
    }
  }
  transform: [
    {
      calculate: datetime(datum._source['timefield'])
      as: time
    }
    {
      calculate: datum._source['km']
      as: Kilometers
    }
  ]
  mark: {
    type: circle
  }
  encoding: {
    x: {
      field: time
      type: temporal
    }
    y: {
      field: Kilometers
      type: quantitative
    }
  }
}

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