# Component Error Time series chart with a query

**URL:** <https://forum.inductiveautomation.com/t/component-error-time-series-chart-with-a-query/97731>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 24, 2024, 2:04pm UTC](https://forum.inductiveautomation.com/t/component-error-time-series-chart-with-a-query/97731 "2024-10-24T14:04:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diego\_Mejia](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@Diego\_Mejia](https://forum.inductiveautomation.com/u/Diego_Mejia)\
**Post date:** [October 24, 2024, 2:04pm UTC](https://forum.inductiveautomation.com/t/component-error-time-series-chart-with-a-query/97731/1 "2024-10-24T14:04:43Z")

</div>

Good morning, I am trying to put a query in the data of a Time series chart but I always get an error, I think the data is ok, the time is in date and the tag value in double, the data is sorted, I don't know what could be wrong.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/e/eee0b1a79cdcd5cc5c8dd65cfc28cabaa9112ea3.png)

---

<div class="post-metadata">

**Author:** ![ryan.perretta](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.perretta/32/75110_2.png) [@ryan.perretta](https://forum.inductiveautomation.com/u/ryan.perretta)\
**Post date:** [October 24, 2024, 3:25pm UTC](https://forum.inductiveautomation.com/t/component-error-time-series-chart-with-a-query/97731/2 "2024-10-24T15:25:26Z")

</div>

Could you show how you are binding the data to the Time Series chart?

Without seeing that, it looks like the data is configured correctly according to the last point in this tooltip for the `data` property of the series list items.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/c/bc0bb130b0d925ef10de8bc4add383e5f02762d9.png)

Make sure that when you are binding to the series you keep the structure the same: a list of dictionaries that have a `name` and `data` key where `data` would be the dataset from your query.

---

<div class="post-metadata">

**Author:** ![Diego\_Mejia](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@Diego\_Mejia](https://forum.inductiveautomation.com/u/Diego_Mejia)\
**Post date:** [October 24, 2024, 3:31pm UTC](https://forum.inductiveautomation.com/t/component-error-time-series-chart-with-a-query/97731/3 "2024-10-24T15:31:43Z")

</div>

> [@ryan.perretta](#):
>
> binding

Hello, thank you for your prompt reply.  
here is the binding, it is a query to a database, there is no column with a key

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/a/0a56451bf6029ed610c46ccac7c99b8a33c46228.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/f/ffeeb13c5f47bd87a2c602914d44e216c07b81e5.png)

---

<div class="post-metadata">

**Author:** ![ryan.perretta](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.perretta/32/75110_2.png) [@ryan.perretta](https://forum.inductiveautomation.com/u/ryan.perretta)\
**Post date:** [October 24, 2024, 3:40pm UTC](https://forum.inductiveautomation.com/t/component-error-time-series-chart-with-a-query/97731/4 "2024-10-24T15:40:13Z")

</div>

Take a look at this topic. Could possibly be an issue with the timestamp coming in as `datetime2` type. I have not read through the whole thing, but it may work if you were able to convert the timestamp to a `datetime`

> [@Datetime2 format in EasyChart](https://forum.inductiveautomation.com/t/datetime2-format-in-easychart/2815):
>
> Hi Is it possible to use MSSQL server datetime2 format in EasyChart DB pens? Now it seems to try use datetime even error message says that format should be date? We would like to get millisecond resolution to trend from our data and easiest way is to use datetime2. Br Tommi Vahtera THT Control Oy

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [October 24, 2024, 5:11pm UTC](https://forum.inductiveautomation.com/t/component-error-time-series-chart-with-a-query/97731/5 "2024-10-24T17:11:49Z")

</div>

> [@ryan.perretta](#):
>
> it may work if you were able to convert the timestamp to a `datetime`

That is a very old post, and it's for the Vision Easy Chart, not the Perspective Time series chart.  
There should not be any issue with the `datetime2` column data type and I would not recommend converting to `datetime`.

@Diego_Mejia try changing your query to look like this:

```SQL
SELECT TOP 100 t_stamp as 'time',Tag1,Tag2
FROM test5
ORDER BY t_stamp

```

Then change your Return Format to JSON.

---

<div class="post-metadata">

**Author:** ![Diego\_Mejia](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@Diego\_Mejia](https://forum.inductiveautomation.com/u/Diego_Mejia)\
**Post date:** [November 25, 2024, 5:55pm UTC](https://forum.inductiveautomation.com/t/component-error-time-series-chart-with-a-query/97731/6 "2024-11-25T17:55:41Z")

</div>

Hi, sorry for the late reply, you're right hahahah the column should be called 'time'.
