Prerequisites
- A working Risksheet document with risk items
- Access to the sheet configuration sheet configuration
- Familiarity with CSS color properties
How Item Color Styling Works
Risksheet uses three configuration properties that work together to apply data-driven colors:cellDecorators— JavaScript functions that evaluate cell values and apply CSS classesstyles— CSS class definitions that specify colors, fonts, and backgroundsheaders.rowHeader.renderer— Optional row header renderer for applying colors to the row header column
| Configuration Flow | ||||
|---|---|---|---|---|
| cellDecorators styles Grid Display | ||||
| rpn: function() | ------> | .rpn1 { green } | ---> | Cell: 120 (green) |
| evaluates value | .rpn2 { yellow } | Cell: 250 (amber) | ||
| applies CSS class | .rpn3 { red } | Cell: 400 (red) |
Define Cell Decorator Functions
Cell decorators are JavaScript functions that inspect cell values and toggle CSS classes. Add them to the The
cellDecorators section of your sheet configuration:info parameter provides:| Property | Description |
|---|---|
info.value | The current cell value |
info.cell | The DOM element of the cell |
info.item | The full work item data for the row |
Define CSS Styles for Color Classes
Map the CSS classes used in your decorators to actual color definitions in the This example creates a three-tier color scheme for Risk Priority Numbers (RPN):
styles section:| Class | Range | Background | Text | Meaning |
|---|---|---|---|---|
rpn1 | 1 — 150 | Light green (#eaf5e9) | Dark green (#1d5f20) | Low risk |
rpn2 | 151 — 250 | Light yellow (#fff3d2) | Dark amber (#735602) | Medium risk |
rpn3 | > 250 | Light red (#f8eae7) | Dark red (#ab1c00) | High risk |
Assign the Decorator to Your Column
Reference the decorator name in the The
cellRenderer property of the column that should display conditional colors:cellRenderer value must match a key defined in the top-level cellDecorators object.Color Row Headers
To apply color coding to the row header column for at-a-glance risk visibility, configure a custom renderer in the
headers section and pair it with a cell decorator that reads from the work item:Common Color Palettes
Recommended color combinations for standard risk analysis use cases:| Use Case | Low | Medium | High |
|---|---|---|---|
| RPN (3-tier) | #eaf5e9 / #1d5f20 | #fff3d2 / #735602 | #f8eae7 / #ab1c00 |
| Status flags | #e8f5e9 / #388e3c | #e3f2fd / #1565c0 | #ffebee / #b71c1c |
The color palettes above are suggested starting points. Adjust the threshold values in your
cellDecorators functions to match your organization’s risk classification scales and standards.Verification
After saving your sheet configuration and refreshing the page:- You should now see RPN cells color-coded green (1—150), yellow (151—250), or red (>250)
- Row headers should reflect the revised RPN color for each risk item
- Column group headers should display the configured section colors
rpn1, rpn2, rpn3) are being applied to the cell elements.
See Also
- Apply Conditional Formatting — broader conditional formatting patterns
- Configure Cell Styles — general cell styling options
- Configure Row Header Styles — row header customization
- Configure Calculated Columns — set up formulas that drive color-coded values