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

Cannot bind the result from a service to a time series chart

iherreros
Participant

Cannot bind the result from a service to a time series chart

Hi there!

I am getting data from another cloud through a service and I can bind the data to a grid but I cannot bind the same data to a time chart series. This is what I'm trying to do:

I have a list bind to a grid and whenever I select one option from the list, the respective data is displayed on the grid. I would like this very same data to be displayed on the chart as well, but I don't get anything. Besides, in the time chart properties I cannot select anything in the X and Y fields, it is blank.

I know how to do this with Kepware but I have no clue about how to do the same thing in this case.

Hope you can help me.

Thanks in advanced!

10 REPLIES 10

Re: Cannot bind the result from a service to a time series chart

Do you have a datashape assigned to the output and if so, is the timestamp a basetype datetime?

Re: Cannot bind the result from a service to a time series chart

Hi Pai,

Yes, I have.

This is the data shape:

And this is what I get when a call the service in the mashup:

Any clue?

Thanks and best regards.

Re: Cannot bind the result from a service to a time series chart

Looks like it is actually your Value field, change that to be a Number.

Time series chart can only plot Numbers over time, if you need a String, you can try it with a Label chart?

Re: Cannot bind the result from a service to a time series chart

Thanks Pai,

Now at least I can see the axis and the legend "value", but the date seems to be invalid.

I have formatted the data as this is how it really comes from the API

to:

But it is not working either, am I missing something?

Re: Cannot bind the result from a service to a time series chart

you can try two approaches

1. cast it directly to the datetime field see if it takes

2. you'll need to use the Date() function to convert your data

Re: Cannot bind the result from a service to a time series chart

Hi Pai,

This is what I get when using Date() function:

This was my first approach:

Second approach:

Both produce the same result above.

Thanks.

Re: Cannot bind the result from a service to a time series chart

The date looks good, how did you define the X axis in the chart properties?

Actually try the following, using the Date() function formatted service.

Remove your time series chart and put a new one in there, drop the data on it and then just view the mashup

Re: Cannot bind the result from a service to a time series chart

HI,

Not very sure about how to use that service... It is this service, isn't it?

I'm getting an error:

I have also used STRING but same error..

Re: Cannot bind the result from a service to a time series chart

Just use Date() (java script function)

However that first result looks like a good result that I think Thingworx should be able to use.

Re: Cannot bind the result from a service to a time series chart

Hi Pai,

I have found finally the problem...a quite silly thing, in the datashape declaration the basetype of timestamp was STRING instead of DATETIME. I just copied and pasted the datashape declaration from other code... lazy girl!!

Now it is working

Many thanks for all your help!!

Best regards.

Announcements

Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.