# Vega Scatterplot for Transform Index

**URL:** <https://discuss.elastic.co/t/vega-scatterplot-for-transform-index/324936>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [February 7, 2023, 8:55pm UTC](https://discuss.elastic.co/t/vega-scatterplot-for-transform-index/324936 "2023-02-07T20:55:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mundruid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mundruid/32/114363_2.png) [@mundruid](https://discuss.elastic.co/u/mundruid)\
**Post date:** [February 7, 2023, 8:55pm UTC](https://discuss.elastic.co/t/vega-scatterplot-for-transform-index/324936/1 "2023-02-07T20:55:56Z")

</div>

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:

```auto
{
  $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!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 7, 2023, 8:56pm UTC](https://discuss.elastic.co/t/vega-scatterplot-for-transform-index/324936/2 "2023-03-07T20:56:45Z")

</div>

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