Easy chart db pens won't display multiple pens

I’m attempting to display data from a database table using DB Pens in an Easy Chart component. The table is laid out similar to Ignition historical data tables, except a few extra columns were added for ease of querying data for specific instruments. The table has the following columns:

dataID (int)
d_insert (datetime)
locationID (int)
tagID (int)
instID (int)
d_value (double)

Data from the instruments is stored in the value column, timestamp is stored in the d_insert column as a datetime as opposed to unixtime, and instrument metadata is stored in the location, tag, and instrument ID columns.

In the DB pens the COL_NAME and XVAL_COL_NAME are all the same and the WHERE_CLAUSE has “tagID = ” to select the correct data.

image

This works fine for one DB pen, however with multiple pens the chart appears to perform multiple queries and update the chart for each one and the data that gets displayed until the next refresh is whichever query was completed last.

Is there a reason it won’t display the pens on the same chart? Is there a setting I’m missing? If using the where clause column results in this behavior then why offer the where clause column at all?

Expected Result:

Actual Result:

I use the where clause without problems in a number of applications. Please show your whole pen configuration dataset. Also, do you have an index defined on d_insert and tagID? If not, it’ll work poorly. Like, take forever to update.

Here are all of the columns in the dataset:

After watching the chart for a while, it appears that more is happening than only showing one pen. It appears that it runs several queries and shows all of them, but they overlay each other rapidly…

Clicking on the “run diagnostics” button results in the following. Good call on the index thing, let me see what I can do to fix that.

image

The d_Insert column is now indexed, however it does not appear to have changed anything in relation to chart behavior.

image

Haven’t-read-the-thread-exhaustively guess: Are you deliberately setting the range on the axis, or is it auto ranging? Your ‘actual’ vs ‘expected’ has a very narrow range specified, which doesn’t appear to be wide enough for any of the other pens on your ‘actual’.

It’s auto range. There should be several pens with somewhat flat values in these ranges:

image

Something to note, that I did not mention earlier however it seems to be a factor, is that I was populating the data table using an SQL query binding. I removed the binding and added several tags manually and they display correctly, however I need to be able to dynamically fill in the pen data. I’m going to make sure the query returns correct data for most of the columns, however I notice that the data table has one column of the “color” datatype…

I figured it out. The chart REALLY did not like that I had multiple pens with the same name. Don’t do that.