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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Pie chart Widget not working

Aditya1702
15-Moonstone

Pie chart Widget not working

Hello,

Good Morning,

 

I am trying to use pie chart widget in thingworx mashup, but not able to achieve the output.

 

I have a service which has infotable as an output(Service.png). I have bound all data of that service to pie-chart widget(Binding.png) in thingworx mashup. After viewing the mashup it says no data in mashup(Mashup.png).

 

I have attached the reference images, can anyone help me out with the same.

 

Thanks in Advance.

 

Regards,

Aditya Gupta 

ACCEPTED SOLUTION

Accepted Solutions

What your service returns (columns StepStatus  and COUNT_StepStatus) does not match the Datashape you defined as shape for the result infotable. Those need to match because in a mashup, you can only bind the fields defined in the Shape, not the ones that are actually returned by the service. In your case it might be the easiest after the aggregate to Run to RenameField service so the infotable columns match the ones from the datashape.

result.

Resources["InfoTableFunctions"].RenameField({t: result, from: "StepStatus", to: "PropertyName"});
Resources["InfoTableFunctions"].RenameField({t: result, from: "COUNT_StepStatus", to: "Count"});

 

In your mashup, bind "All Data" from the service to "Data" of the pie chart, and set LabelField to PropertyName and ValueField to Count.

View solution in original post

4 REPLIES 4

You will have to bind ValueField and LabelField with values from your result infotable, so they would be either StepStatus or Count_StepStatus, not "Propertyname" as in the screenshot.

Also the service Output ("result") would have to be not only set to Infotable, but needs a datashape assigned.

Aditya1702
15-Moonstone
(To:Rocko)

Hi @Rocko ,

 

Actually I have service named GetPassFailCount with Inspection_PassFailCount-DS as the datashape which has field definiton (PropertyName & Count).

Hence in the previous screenshot the DataField was set to PropertyName.

 

Can you guide me in what way I can show the pass/fail count in pie chart. 

I have QueryDataEntries which has a column named StepStatus with Pass/Fail as its values.

 

Also the GetPassFailCount service counts the number of pass/fail values of QueryDataTableEntries Service.

 

 

What your service returns (columns StepStatus  and COUNT_StepStatus) does not match the Datashape you defined as shape for the result infotable. Those need to match because in a mashup, you can only bind the fields defined in the Shape, not the ones that are actually returned by the service. In your case it might be the easiest after the aggregate to Run to RenameField service so the infotable columns match the ones from the datashape.

result.

Resources["InfoTableFunctions"].RenameField({t: result, from: "StepStatus", to: "PropertyName"});
Resources["InfoTableFunctions"].RenameField({t: result, from: "COUNT_StepStatus", to: "Count"});

 

In your mashup, bind "All Data" from the service to "Data" of the pie chart, and set LabelField to PropertyName and ValueField to Count.

Aditya1702
15-Moonstone
(To:Rocko)

Hi @Rocko ,

 

I changed the Field Definitions of "Inspection_PassFailCount-DS" to (StepStatus & COUNT_StepStatus) so, that 

it matches the output of "GetPassFailCount" service. Also bound the all data & followed the procedure as mentioned by you & it worked.

 

Thank you for your guidance.

 

Best Regards,

Aditya Gupta.

Announcements


Top Tags