Perspective Time Series Chart Component Error

I'm trying to plot some queried data in Perspective. My query works on tables just fine:
image
The script for this:

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:

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:


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?

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

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

2 Likes

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.

1 Like