Can I populate a chart using a SQL view? I have views that give me just the data I want to see. I would like to use Ignition’s charts to display that data, but I can’t figure out how.
The classic chart will work for this, You can bind the dataset to a view w/out trouble.
I don’t think the Easy Chart will right now though?
Thank you, Dravik. Could you by any chance point me in the direction of some instructions for that?
Update: Ok, I figured out how to connect it to the view (I think…). Now it’s just a matter of figuring out how to show the columns I want.
If you bind the Chart Component’s Data property to a SQL Query, you could pick and choose which columns you need the Chart to display. For example:
SELECT [column1], [column2]
FROM [view]
Either chart should allow you to use data from a view since views are queried in the same way as any table. IE populate the data property of a simple chart with a SQL Query:SELECT col1, co2 FROM myview WHERE x
or populate the DB pens of an Easy chart by typing the view name in the table name field and the column in the value field.
Just be careful because every time the view is queried, it will go run the query that populates it.
Robert, is there a way to set the refresh rate of the chart? I don’t need it to refresh more than once every 30 seconds.
I just noticed the polling rate field on the chart binding screen. If I set this to 30 seconds, will Ignition only query the view every 30 seconds?
Yes if the Polling Mode is set to Absolute. If the polling mode is Relative then it will be the base rate + 30 seconds. The project Base Rate is 5 seconds by default and the setting exists in the Project Properties under Client -> Timing.