Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To achieve that, we use the Unicode symbol FISHEYE and the Pricefx feature "api.attributedResult(...).withTextColor(...)" to return the symbol in color:

Green circle
paste-code-macro
title
languagegroovyGreen circle
def circle = "\u25C9"
return api.attributedResult(circle).withTextColor("green")

or

Red circle
paste-code-macro
languagegroovytitleRed circle
def circle = "\u25C9"
return api.attributedResult(circle).withTextColor("red")

...

Useful links to find the right symbol:

Unicode in Groovy

The "escape syntax" for Unicode characters can be used when you need to use "special" Unicode characters in the Groovy source code (note that the same applies to Java).

The escape syntax is as follows:

...

\u<hexacode>

...

or

...

\U<hexacode>

...

So for example, when you need to show the below circle, you can use the Unicode symbol FISHEYE that has code "\u25C9", as you can see in the example below:Image Removed

...

Output

And this is the output, the way the symbol is displayed in Pricefx.

In the "classic" UI, in Table View:Image Removed

...


In Unity UI - Table View:Image Removed

...

In Unity UI - Tree View:Image Removed

...