Skip to main content
1-Visitor
April 10, 2017
Question

How to use Bar Chart in ThingWorx Studio

  • April 10, 2017
  • 2 replies
  • 3836 views

Hi ,

      I have a bar chart and i have to display some data on it. I don't know the format of data. i want to get the data from any function(let's say getData()). when a button is clicked it should call the function, get the data and display it on bar chart.

Thanks and Regards,

Qadir

2 replies

5-Regular Member
April 11, 2017

The bar chart functionality is quite similar to ThingWorx (composer) bar chart, the input format should be of infotable type. You can add the external data and bind the service result (of infotable type) to the 'data' property of the widget.

qumar1-VisitorAuthor
1-Visitor
April 13, 2017

Hi giri, let me try what you suggested, i am going to create the function in .js file and will invoke it on button click event. Is there any way to change the css of vertical of charts, specially color of different vertical of y-axis?

Regards,

5-Regular Member
April 17, 2017

Qadir umar​,

If you are using Data from ThingWorx; you can actually bind the Button directly to the service to call the service on button click. So, on click of Button service will be called and show the Data in ThingWorx Studio.

qumar1-VisitorAuthor
1-Visitor
April 17, 2017

Ankit Gupta​, i don't want to get data from Thingworx, i want to call the function in my .js file , in the function i will create data manually in same format as we get from thingowrx. the real question is , in my chart if we have four vertical along y-axis , i want to change the color of only one vertical dynamically based on data we are providing.if the data is less than 12, it should be fill red color.

chart.PNG

for eg. we have chart  Tempreture vs Month graph, i want to fill the red color to my verticals if tempreture is less than 12 degree Celcius. This is my actual requirement .