How to :: add stars to tile’s title¶
Tile’s staring¶
This is how you can display stars in the widget name using the ‘stars’ filter.
Warning
- For now, the available widgets are:
- value-dynamic
- score-card
- leaderboard
Please see the widgets’ specific documentation for more info on how to use this feature.
Configuration¶
In some widgets, you can display a value between 0 and 1 (percentage for instance), as stars next to the tile’s title.
Usually in places where you can write:
name: "some text <$= my_dataset.column $>"
If the value is between 0 and 1 you can use the stars method like so:
name: "some text <$= stars(my_dataset.column) $>"
Note
This does not work if you’ve setup precision to convert your value into %. Instead, use the syntax : <$= stars(my_dataset.column/100) $>
Ex:1 value dynamic tile¶
Data Sources
Let’s say these are your data :
| rating | value | label |
| -------- | ----------- | ---------- |
| 0.3 | 15.3 | metric |
Configuration
name: "Metric <$= stars(my_dataset.rating) $>"
type: 'value-dynamic'
value: "value"
unit: "%"
(...)
data:
rating:
query:
domain: "ranks"
"Retailer name": "France"
breakdown: "<%= requestersManager.date %>"
field: "rating"
(...)
Old home syntax¶
For the old home, use the following syntax :
name: "some text <%= stars(valueFromDatas) %>"