CellIcon
This function is not officially supported or exposed on menus yet and may be subject to change in a future release. It was first introduced in Analytica 5.0..
CellIcon( icon, side )
Displays an image (icon) in a cell, next to a cell value. «icon» is an image. «side» can be 'Right'
, 'Left'
or 'IconOnly'
.
This can be used from the Cell Format Expression attribute.
Examples
The above screenshot uses CellIcon in two ways. First, an icon appears to the right of Staff development, indicating that the projects are sorted in decreasing order by the values in that column, and second, in the Net revenues column to show the the sign of the value. These were implemented using the following code in the Cell Format Expression attribute:
- CellFormats(
- )
The first item in the outer CellFormats implements the column sorting. A variable in the model, vis_icon, computes which icon to display (it is defined as If Sort_descending Then icon_descending Else icon_ascending
). The model contains logic that sorts the Project index, which is beyond the scope of this discussion. The CellSpan with header:true
puts the icon in the header cell.
The second item in the outer CellFormats list implements the green up and red down arrows.
Enable comment auto-refresher