Skip to main content
1-Visitor
March 14, 2016
Solved

Style Definitions as a property or variables

  • March 14, 2016
  • 1 reply
  • 2998 views

Is it possible to set a style definition as a property of a Thing?

Alternatively, would a style be able to take number values from Thing properties to customize the colors automatically, rather than defining each thing individually?

Thanks!

Best answer by Aanjan

Hmmm I understand what you're trying to do, but I don't think this would work like you expect because state definitions are not bound by Things. For example, based on your location, you can have it display a certain image/ color. This is limited to the actual location's value regardless of the Thing. If the state definition has been set to all blue at -50 F for a location like South Pole, it would always abide by -50 F and not care if it the value comes from Thing1 or Thing2. Does this make sense?

1 reply

5-Regular Member
March 14, 2016

Gloria, Style Definitions are more like attributes for a Widget, rather than a Thing. If you want the colors to change automatically, they can be done on certain widgets like Radio Buttons, Shape widgets or even Grids, through the usage of State Definitions/ State-based formatting. With State Definitions you can choose what colors/ styles are displayed based on the range you set.

gsee1-VisitorAuthor
1-Visitor
March 14, 2016

Then is there a way to customize the state definitions for different things? I'd like to have high, middle, low values formatted the same way for multiple Things, but the values depend on each Thing.

5-Regular Member
March 14, 2016

Well, it depends on how you're implementing the said Things and binding them. Usually, the states go by values - for example you can set anything below 20 to be all red and anything above 80 to be all green.