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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Line Chart X-Axis limits not working correctly

kevinb_kad
5-Regular Member

Line Chart X-Axis limits not working correctly

Hello everyone,

 

I have a simple mashup where I want to display data coming from a value stream. I have a remote thing connected to a KepServer Gateway that retrieves sensor data each second. In the mashup builder, I add the queryPropertyHistory service for the data.

 

Now I insert the Line Chart (Version is Thingworx 9) and link the data from the query to the chart (I choose three signals for the Y Axis and the timestamp (DATETIME) for the X Axis. I also choose maxItems for the query (e.g. 1000). 

 

Now when I open the mashup, the data is loaded and shown properly and is also refreshing and adding the latest data each second. The problem is, that the X-Axis is way to widely scaled for the data points shown (see screenshot). My expectation would be that the X-Axis is limited to something like minimum timestamp in the data query to maximum timestamp in the query (and the window moves with the data). How can I achieve this?

 

kevinb_kad_0-1604999314123.png

 

I tried using the 'XAxisMinimumValues' and 'XAxisMaximumValues' parameter of the line chart but it does not seem to work at all. If I put a time stamp there (e.g. Minimum is 20 minutes before 'now' and maximum is 'now'), it shows the same range of the X-Axis as on the screenshot. Any idea why these parameters do not work?

 

Help is very appreciated, in case you need more info feel free to ask.

 

Regards,

Kevin

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @kevinb_kad,

 

It seems that QueryPropertyHistory is invoked on the value stream with the maxItems set to a specific value.

If we have an example with 3 properties having 3 separate entries, then the total number of data points would be 9.

QueryPropertyHistory queried each individual property three times because the maxItems was set to three.

Since there were three data entries for each property, the maximum amount of Items returned was possible: nine rows.

 

Hope it helps,

View solution in original post

3 REPLIES 3
kevinb_kad
5-Regular Member
(To:kevinb_kad)

Addition: I think I could already narrow down one part of the problem. If I execute the queryPropertyHistory in a minimum example I noticed some strange things (see screenshot). If I query 5 maxItems in either direction (oldestFirst true or false), I

- get more than 5 rows (6 with oldestFirst=true, 8 otherwise)

- get the first 5 results from either the oldest or newest data point but also get one row with a much older data point (if I start with the newest). This seems to be the left end of the X-Axis in the chart. Why is this included in the query result?

Hello @kevinb_kad,

 

It seems that QueryPropertyHistory is invoked on the value stream with the maxItems set to a specific value.

If we have an example with 3 properties having 3 separate entries, then the total number of data points would be 9.

QueryPropertyHistory queried each individual property three times because the maxItems was set to three.

Since there were three data entries for each property, the maximum amount of Items returned was possible: nine rows.

 

Hope it helps,

kevinb_kad
5-Regular Member
(To:Ciprian-Traian)

Dear @Ciprian-Traian ,

 

thank you for your answer. I guess I just had a different understanding of what maxItems would do in querypropertyhistory. With your explanation it makes sense, I will now use a different service to retrieve exactly what I need.

 

Can be closed.

Top Tags