I'm currently building a custom symbol that provides a specific visualisation on customer requirement. The symbol takes an element as input (DatasourceBehaviors.Multiple), and uses the datashape "Table". From the set of attributes defined on the element, and thus added to the sourcelist of the symbol, it derives the following:
- Using a batched call to the PI Web API, for a number of attributes the WebID is retrieved
- From a number of attributes, the value is taken using the regular dataupdates on the symbol
- On the same dataupdate, a batched call to the PI Web API is used to return plotvalues using the WebIDs previously returned
Now this raises a few questions if i'm doing this the right way:
- Every time i get the dataupdate, it will perform the plotvalues call. This seems rather wasteful to me as 95% percent of the data won't change. I think i can't use the DataShape: 'TimeSeries' / DataQueryMode: CS.Extensibility.Enums.DataQueryMode.ModePlotValues, as the data i need to plot is NOT over the same data range as the display.
- The plotvalues return as 4 separate sets of data with values and timestamps. If these are called with the same parameters (starttime, endtime, intervals), do they always return the same number of results? On my amCharts charting lib, i need to provide a dataset with a single timestamp for all plotvalues. How to combine the results to ensure i can add the separate sets into one dataset for the chart?
Or maybe my approach should be different altogether?
The approach in PI-Coresight-Custom-Symbols/Community Samples/OSIsoft/amcharts-trend at master · osisoft/PI-Coresight-Custom-Symbols · G… does not have this specific problem as this example only plots the first item...