I’m interested in finding out how FactoryPMI charts data.
As long term users of GE Fanuc’s iFIX, we had one big bugbear with its charting - it could draw misleading plots of the data. For example, if the chart area on the screen was 1000 pixels wide, the charting algorithm would look up the data to be charted and plot 1000 evenly spaced points. This would have the result of potentially missing momentary peaks and troughs in the data.
We came across another package which had a good solution for this problem. In the above example it would divide the data into 1000 blocks, then return the maximum and minimum values for each block. The chart would then draw a vertical line for each area between the maximum and minimum values. This meant that no matter how far you were zoomed out, you would still get an accurate picture of how the trend had varied.
As far as I know, FactoryPMI does not do this. Does it take another approach, or is this something that could be included for the future?
FactoryPMI charts would not be deceptive (provided that the axis is autoscaled), but don’t behave exactly as you’re looking for.
I tested by making one temperature value in my historical data 350, where the rest were under 120. If I zoomed out several days (3600 sets of data points), you could tell that a spike existed in that time frame because the Y axis would autoscale appropriately. I had to zoom in a little (still surprisingly far out) before actually seeing the spike on the graph.
I can’t imagine such a short and important spike that would go unnoticed. If your process has these, simply display the minimum and maximum values for each range on the screen somewhere - or train the operators to watch the axis. The Zoom and Pan can re-render the chart quickly enough to easily spot the culprit.
To answer your question - I’d guess that the chart is rendering every so many points, but the axis set to autoscale obviously uses the min() and max() values. [del]A good place to ask about specific behavior is this forum. FactoryPMI charts use JFreeChart, so you’ll probably get your best answers there.[/del] I’ll investigate their site to see if they have a renderer (would be a “pen type”) that behaves as you described - maybe something like this.
Edit - you might also be interested in playing with their chart examples here (JWS demo).
FactoryPMI charts are based on JFreeChart, but when we start getting into questions like this, we’re delving into territory where FactoryPMI has implemented some very custom deviations from standard JFreeChart (hence the strikethrough I added to Nathan’s post above.)
On a chart with a very large dataset, the current implementation does indeed skip datapoints when there is no room to draw them. This can lead to slightly misleading charts in the case of a short lived outlier point, although as Nathan suggested, an auto-scaled Y axis will give a hint that the outlier exists.
I like the suggestion you have proposed, Al. I remember discussing this on the phone with you some months back, and that suggestion has stuck in my mind. It hasn’t made it into the implementation yet, but it is definately a well-noted feature request.
My explanation perhaps wasn’t very clear - each ‘chunk’ of data is represented by a vertical line only one pixel wide, which is plotted between the maximum and minimum values of the chunk of data. The vertical line for the next group is plotted one pixel to the right and so on. By doing this the essential shape of the graph is maintained, no matter how far out you zoom.
As far as I can make out, this approach will not care whether the data is evenly spaced or not, although the groups the data is split into will have to be evenly spaced. This will mean interpolating values if no data exists for a particular time period. The group in that case will be represented by a single dot drawn at the interpolated value.