Change DB tables in charts based on external conditions

In a chart, can I change the table that a pen is pointing to, based on some condition? Ideally, I’d like to use the value of a SQLTag or a property (a la indirect tags) in the table name. That way, I can display the correct data for device 1 or for device 2, using the same chart screen.

Thanks.

There are several ways to skin that one. An Easy Chart stores its pen configuration in an Expert Property dataSet. You can bind that to an SQL database query, allowing you to control pen configuration via the database.

The original Chart component’s data is a dataSet, which can easily be bound to a dynamically generated SQL query.

[quote=“bds”]In a chart, can I change the table that a pen is pointing to, based on some condition? Ideally, I’d like to use the value of a SQLTag or a property (a la indirect tags) in the table name. That way, I can display the correct data for device 1 or for device 2, using the same chart screen.

Thanks.[/quote]

Cool. I will play with that. Thanks.

Related, I have the same issue with a plain old Chart component, which I am using to display an X-Y scatterplot. Can I display data from different tables in this case?

Sure. The query that provides the classic chart’s data can be constructed dynamically. Think something like this:

SELECT t_stamp, value FROM {Root Container.DeviceTable} ORDER BY t_stamp