Skip to main content
14-Alexandrite
March 23, 2021
Solved

how to apply state formatting to label chart or any other chart??

  • March 23, 2021
  • 1 reply
  • 3234 views

Hello,

         I want to apply below state formatting to label chart .Please suggest how do I apply state formatting??? and please refer below attachment 

Thanks in advance

Best answer by c_lowy

Thanks for providing some details on your use case.

 

There is no out-of-the-box functionality in ThingWorx to display colored areas in the background depending on the value of the Y Axis. However, you can apply state-formatting to Label Charts using the Markers ChartType (or Line/Markers, Area/Markers) as shown in the attached screenshot Markers_StateFormatting.jpg.

 

You could possibly dedicate a certain number of series (= number of colors you want to display) displayed as Areas and then add a Line type series on top as shown in attached screenshot Areas+Line.jpg. This is not what the widget's multi-series functionality is originally intended for and this does involve the creation of Chart data especially for the formatting so I will let you decide if this is something worth implementing.

 

Another "cleaner" possibility would be to create a custom widget for this : Creating Customized ThingWorx Widgets.

1 reply

16-Pearl
March 24, 2021

Hi @RM12,

 

Please find attached some entities that can be imported into ThingWorx 8.5 or later and that contain a Mashup with a Label Chart using State-Formatting. At runtime you will see that all values below 5 are displayed in green and all above 5 in red.

RM1214-AlexandriteAuthor
14-Alexandrite
March 24, 2021

Thanks for your reply ,at runtime I will display my  data with multiple colors .I want to display legends as well in dashboard, I have one property name as "Heart Rate"  according to heart rate show legends as below condition :

1) less than or equals to 90 --Blue color

2) greater than 90 or less than 110 --green color

3) greater than 110 or less than 120  -- Yellow

4) greater than 120 --Red 

please refer the below attachments and suggest how to display legends according to above condition ???

c_lowy16-PearlAnswer
16-Pearl
March 25, 2021

Thanks for providing some details on your use case.

 

There is no out-of-the-box functionality in ThingWorx to display colored areas in the background depending on the value of the Y Axis. However, you can apply state-formatting to Label Charts using the Markers ChartType (or Line/Markers, Area/Markers) as shown in the attached screenshot Markers_StateFormatting.jpg.

 

You could possibly dedicate a certain number of series (= number of colors you want to display) displayed as Areas and then add a Line type series on top as shown in attached screenshot Areas+Line.jpg. This is not what the widget's multi-series functionality is originally intended for and this does involve the creation of Chart data especially for the formatting so I will let you decide if this is something worth implementing.

 

Another "cleaner" possibility would be to create a custom widget for this : Creating Customized ThingWorx Widgets.