Theming
The chart is styled with plain CSS and reads eight variables. Set any of them on :root, or on an element around the chart, and leave the rest.
:root { --rt-font: 'Inter', sans-serif; --rt-ink: #1d2433; --rt-retention: #e4e7ec;}Variables
Section titled “Variables”| Variable | Default | Used for |
|---|---|---|
--rt-font | inherit | All text in the chart. By default it takes your page’s font. |
--rt-ink | #162033 | Text, axis lines, the outline of a selected layer. |
--rt-ink-soft | #56627a | Axis labels and the key. |
--rt-surface | #ffffff | The gap under the dashed edge of an unlimited layer. Match your page background. |
--rt-rule | #e8ebf0 | Grid lines behind the tower and the rule above the key. |
--rt-quote-outline |
var(--rt-ink) |
Dashed outline for reinsurer-viewpoint quotes and indications. |
--rt-retention | #d5d9df | The cedant’s retention. |
--rt-loss | #b3261e | The loss wash and its flag. |
An example
Section titled “An example”The same chart with a warmer palette and a serif font:
.my-portal { --rt-font: Georgia, 'Times New Roman', serif; --rt-ink: #3b2f1e; --rt-ink-soft: #7a6a52; --rt-rule: #ece5d6; --rt-retention: #e2dccb; --rt-loss: #a1440b;}Layer colours
Section titled “Layer colours”Layer fills are not CSS variables, because they depend on the data. Layers of one contract share a colour, and colours are handed out in the order contracts first appear, from a set of ten pale fills chosen to keep dark text readable.
To fix a layer’s colour, send display.colorOverride with that layer in your request:
{ "layerName": "First excess", "layerType": "XOL", "display": { "colorOverride": "#ffe0b2" }}With <TowerChart /> you can go further and pass your own fills map.
Dark pages
Section titled “Dark pages”Layer labels are drawn in --rt-ink on pale fills, so the chart reads best on a light surface. On a dark page, put the chart in a light card rather than inverting the ink colour. That is what this site does.
Sizing
Section titled “Sizing”The chart fills the width of its container. Set its height with the height prop. Towers of one risk sit side by side and wrap when there is less than about 280 pixels each.