# Perspective Time Series Chart Component Error

**URL:** <https://forum.inductiveautomation.com/t/perspective-time-series-chart-component-error/78534>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 29, 2023, 10:45pm UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-component-error/78534 "2023-08-29T22:45:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pico\_Sankari](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@Pico\_Sankari](https://forum.inductiveautomation.com/u/Pico_Sankari)\
**Post date:** [August 29, 2023, 10:45pm UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-component-error/78534/1 "2023-08-29T22:45:59Z")

</div>

I'm trying to plot some queried data in Perspective. My query works on tables just fine:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/7/e7b1cbde283d2e584e313fb28c9e23f0f1b5b307.png)  
The script for this:

```auto
def updateTable(self):
            
    queryBase = "SELECT top 1000 t_stamp AS 'Dates'"\
                ",floatvalue AS 'Value'"\
                " FROM sqlt_data_1_2023_08 "\
                "WHERE tagid='286'"
    
    queryText = queryBase + " ORDER BY t_stamp DESC" 
    data=system.db.runPrepQuery(queryText)
    self.props.data = data

```

I tried to get this data into a timeseries chart with a nearly identical script:

```auto
def getData(self):
    queryBase = "SELECT top 1000 t_stamp AS 'Dates'"\
	                ",floatvalue AS 'Value'"\
	                " FROM sqlt_data_1_2023_08 "\
	                "WHERE tagid='286'"
	    
    queryText = queryBase + " ORDER BY t_stamp DESC" 
    data=system.db.runPrepQuery(queryText)
    self.props.series[0].data = data

```

The data shows up:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/1/01b5d335d5e758f616ffea49115483f4f940f7dd.png)  
However, the chart just says component error. Is there something else I need to configure? Is there a way that I can trace what's causing the error?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 30, 2023, 9:53am UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-component-error/78534/2 "2023-08-30T09:53:09Z")

</div>

The chart doesn't know your columns names.  
By default it expects a `time` column/key, try renaming `Dates` to `time`.  
You can probably configure it to use a `Dates` column, but I'm not sure how - I don't use the time series chart very much.

edit: Yea well I don't know. I've been trying a bunch of things that look like they should work, but no dice.  
The timeseries chart component is... weird.

edit2: Even using the same structure as the example chart, I get a component error:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/f/efe718db2d8035b2e8d770350e90a63ca62f97f4.png)

Same names, same timestep, but different values... and it just doesn't work.

---

<div class="post-metadata">

**Author:** ![Pico\_Sankari](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@Pico\_Sankari](https://forum.inductiveautomation.com/u/Pico_Sankari)\
**Post date:** [September 13, 2023, 8:13pm UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-component-error/78534/3 "2023-09-13T20:13:10Z")

</div>

The issue here ended up being that the data needs to be in ascending order. That partially fixed things, but I'm still having issues.
