cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Obtain same behavior as QueryNamedPropertyHistory for Time Series Chart in a custom service

ebrinette
5-Regular Member

Obtain same behavior as QueryNamedPropertyHistory for Time Series Chart in a custom service

Hello community,

 

I am trying to display multiple charts onto the Time Series Chart widget. The number of displayed chart is dynamic and based on user selection within a list widget.

I can obtain the desired behavior by using the QueryNamedPropertyHistory service.

Now, here is my issue. We had to change the architecture of the shapes/templates.

 

 

image.png

 

The list can now display properties from shape B or C. It is only defined at "runtime" (based on user selection on another list).

Which means I have to call dynamic QueryNamedPropertyHistory on TemplateA level. But this doesn't work with Time Series Chart widget like it would when I would called it directly "at the shape level containing the properties".

I tried wrapping the service within a custom service which output an untyped Infotable.

The service itself work (it returns an infotable with a datashape [timestamps/ prop0 / prop1] which varies based on property names. But it the column are not automatically mapped onto the chart widget.

I tried using the QueryImplementingThingsWithNamedPropertyHistory too.

I tried other type of time series chart widget too.

 

Now here are my questions : 

1) Is there a way to achieve the behavior I want with the data model I presented? (Using multiple chart widget and a contained mashup is not a good "scalable" option for me because the number of template will change)

 

2) What happens exactly when we use QueryNamedPropertyHistory? Because the function itself doesn't have a "fix" output type. Yet, within the mashup definition page we have access to the returned data. It's like the datashape is defined internally, which might explain why it works with the chart widget. Is there a way to reproduce this?

 

Thank you for your help!

 

Eric

4 REPLIES 4

You can bind an infotable without column format (you can set a DataShape with only one column = timestamp for the X) on a Timeseries and should work like grid widget "ShowAllColumns". DataShape like:

 

Screenshot 2019-04-03 11.34.13.png

 

And set the desired "NumberOfSeries".

ebrinette
5-Regular Member
(To:CarlesColl)

Hello Carles, thank you for your reply.

 

I tried using a service which outputs an infotable without datashape defined.

I actually return the same format generated by QueryNamedPropertyHistory function.

Which is an infotable with timestamps and the desired column (based on user selection).

As I said, when binding "All data" (from this service) to the Time Series Chart.. The mapping is not "automatic". The widget doesn't select timestamps as X axis and the other columns as Y datasets.

There is no "ShowAllColumns" for time series widget.

You only need to assign the timestamp field for the X field, don't select nothing for the Y, as it are dynamic.

ebrinette
5-Regular Member
(To:CarlesColl)

Tried it, no luck. Thanks for trying to help.

Top Tags