Hello,
we have many charts displayed in Easy Chart components. In our database we have defined the pens, the axes and the subplots. So we can display a specific chart by just entering SQL queries with the desired plot_id (e.g. 565) for
- DB Pens:
SELECT * FROM GraphPens WHERE plot_id = 565;
- Axes:
SELECT ax.* FROM GraphAxes as ax where ax.name in (SELECT pens.axis FROM GraphPens AS pens inner join GraphPlots AS plots ON pens.plot_id = plots.id where plots.id = 565)
- Subplots:
SELECT * FROM GraphSubplots where plot_id = 565
In the designer it normally works as expected and we get the desired chart. But if we open the page in the client (or open the page in preview mode of the designer) all but the date panel of the chart becomes invisible.
Even when removing the bindings of Axes and Subplots (DB Pens make no problems) the chart does not always come back. What helps is cutting the chart and pasting it. The client (or designer) throw the following exception:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.inductiveautomation.factorypmi.application.components.chart.PMILineChartPanel.createChart(PMILineChartPanel.java:131)
at com.inductiveautomation.factorypmi.application.components.PMIEasyChart$ChartUpdater.run(PMIEasyChart.java:705)
at com.inductiveautomation.ignition.client.util.EDTUtil$ProcessQueue.run(EDTUtil.java:127)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
On one of our pages even had the problem that not only did the Easy Chart component disappear but also a Template Repeater that had nothing to do with it. I could even reproduce it by just inserting and removing the SQL query for the subplot while the DB Pens query is still active and Axes has no binding.
What is strange about all that: If we enter the SQL queries for Axes and Subplots in the designer (we always have the Polling Mode set to off), apply it, and then remove the binding, everything works fine. When applying the query we get the desired values from the database and when removing the binding they are still there of course. And then everything is OK. So what is the problem with these SQL bindings?
Has anybody ever had similar experiences or any idea of how to solve that?
Best regards,
Markus