Vega Scatterplot for Transform Index

I am creating a scatter plot for an index that was generated by a pivot transform and it does not have timestamps. I saw some similar posts and my schema followed these:

{
  $schema: https://vega.github.io/schema/vega-lite/v5.json
  mark: point
  data: {
    url: {
      %context%: true
      %timefield%: length
      index: transform-index
      body: {
        size: 10000
        _source: [
          length
          width
        ]
      }
    }
    format: {
      property: hits.hits
    }
  }
  transform: [
    {
      calculate: toDate(datum._source['length'])
      as: time
    }
  ]
  encoding: {
    x: {
      field: time
      type: temporal
      axis: {
        title: false
      }
    }
    y: {
      field: _source.width
      type: quantitative
      axis: {
        title: width
      }
    }
  }
}

The code above generates the following error and does not generate a plot:
EsError: failed to create query: For input string: "2022-02-07T05:00:00.000Z"

Thanks for your time to check this question!

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