8.1 report chart dynamics

Using Ignition 8.1.17,Reporting 6.1.17

The reporting system is surprisingly powerful and flexible, but I am having trouble with a particular issue.

For certain alarms, a report needs to be generated with details of each alarmJournal instance in the given time window. The details consist of a timeseries chart, or charts, of alarm-specific analog and digital historic tag data, from a period of minutes before the alarm, from a pre-defined diagnostics list.

We can limit the number of analog and digital pens because this is a report, and too many data points will make it unreadable. Target is 0-6 Analog, 0-6 Digital per chart. Getting the data was simple enough, but getting the data into the report has been my challange.

I started with 2 analog signals. The dataset for that contains 4 columns [Fault_Time, t_stamp, Analog01, Analog02]. I made a table with the dataset as the datakey, and grouped by Fault_Time. I made the Fault_Time detail unstructured and inserted a timeseries chart. I set the chart pens to the two analog columns and everything worked just fine.

Except, what if I want digital? I fgured I could put the actual name of the tag as the columnName, and append "_alg" or "_dig", which could be used to differentiate the tags for a script to create dynamic pens and point at the correct column. The report needs to automate the changing of chart scaling and pen count and pen source for each different alarm.

I have been trying to dynamically create pens, but I have only been able to create a headache, reading org.jfreechart and trying figure out which objects contain which others and I swear half of them are named 'Legend' :slight_smile:

Am I going about it a wrong? Perhaps there is a friendlier way to accomplish what I'm trying to do? I'm open to suggestions!

As an bonus question, can anyone tell me what a '$' signifies in a <type>? I came accross com.inductiveautomation.rm.shape.j2dshapes.AbstractXYChart$RpgXYDataset. There is a doc on the AbstractXYChart, but nothing about RpgXYDataset. Running a dir() told me that wasn't an AbstractXYChart.

That means that the final name is a nested class. In general use, replace the $ with a period. However, nested classes, unless static, have to be created from within their parent class to have the proper ownership relationship. You generally cannot instantiate those yourself (without much grief).

1 Like

Perhaps I am mis-understanding what exactly you're trying to accomplish. While it is definitely possible to add "pen" data to an XY Chart through the org.jfreechart packages, really in the context of Ignition, you would use that more for modifying the way the chart is rendered or to use a non-standard Axis type.

Some type of Keychain expression might work? Maybe have a flag column in the dataset to indicate if it's analog or digital, and then you could use a conditional Keychain to change the data-key you're looking at?

Said another way, I need a report that is grouped per alarm occurance and provides a chart, or charts, showing our most common related data points 5 minutes or so before each alarm occurance (Temperatures, pressures, levels, positions, setpoints, and pushbuttons).

The number of analog and digital historic tags will be variable depending on the alarm. One alarm may only need to show the position of two servo heads and discharge table 'Ready' status, while another may require position, temperature, calculated material growth factor, material length, user setpoint, and motor current.

If I were to change the column names to A1,A2, D1, and D2, for instance, I should be able to set up the maximum number of pens as a template. I suppose I could also have columns that are 1-to-1 with the data columns to give the pen names, and populate those in the configureChart script, along with any requisite scaling.

I will do some testing in that direction and see if I can make it to the goal. I will update the post in either case. Thanks!

Pen names do not seem to work with keychains...so that only leaves the script to populate them.

While testing this, my page count jumped from 5 to 9, and now to 13 pages. I do not understand why this is occuring. Below is the design tab. One table on the page, data key = "extras", group by flt_time.

Now, the Preview page shows 5 occurances but 13 pages.

Can anyone tell me what I did to FUBAR this? More importantly: can anyone telll me what to do to fix it?