11.1 How Formatting Works¶
Fonts, colors, borders, alignment and number formats in Datashop are all styles. Knowing how styles inherit from each other explains why a change sometimes affects one cell and sometimes a whole table – and how to give many workbooks the same look.
Every Part Has Its Own Style¶
Each part of a visual is formatted separately:
| Visual | Parts with their own style |
|---|---|
| Table | For each metric, row dimension and column dimension: the label (heading) and the data (values). Each total has its own label and data style. The table frame has one too. |
| Chart | Title, axis titles, legend, axes, plot area, each series, data labels |
| Gauge | Title, legend, the metric |
| Rule | Each rule and condition – see 12.2 Rule Conditions and Styles |
Select the part, and the ribbon's formatting commands apply to it – e.g. click a heading cell of a metric to format all its headings, or a value to format all its values. See 11.2 Formatting from the Ribbon.
Automatic Means Inherited¶
Every setting in a style can be (automatic): the value then comes from the style it is based on. That style can again inherit from its base, all the way up to the built-in Application style – Arial 10, black on white.
So a cell shows:
- what you set on the cell's part, if anything;
- otherwise what its base style says;
- and so on, up to Application.
Inheritance is live: change a base style, and every style based on it changes too – for the settings they leave on (automatic).
Where the Defaults Come From¶
- Metric values inherit from the metric's own format, e.g. its number format – see 10.3 Creating and Editing Metrics. Choose in the number format list to go back to it. This applies wherever you add the metric from – dragging, search, nikolAI, the object tree or a menu – and a table style or template applied later keeps it (build 20381 and later; before, only a metric dropped on a table got its own format, and applying a table style could replace it). A metric without a number format of its own gets the format of the table style, the neighbouring column or the default.
- New table parts get a copy of the built-in styles in Styles → System default → Grid default – e.g. Metric data with format
#,##0.00, or Left pivot label for row headings. - New tables get the Web Modern table style, or the look of the workbook's theme if it has one – see 11.4 Table Styles and 7.8 Themes and Templates.
The Grid default styles are copied when a part is added. Changing them affects tables built afterwards, not existing ones.
Reusing a Style¶
To give many tables or workbooks the same look, create a Style object in the main window's Styles folder and base parts on it: in the part's style dialog, click the button next to Based on and pick the style. Whatever the part leaves on (automatic) then follows your style – change the style once, and every part based on it changes. See 11.5 Style Objects and the Style Editor.
Tips – How Formatting Works¶
- Format as high up as you can: a table style or a Style object is easier to change later than many single cells.
- If a cell won't change, check whether a rule formats it – rules override the cell's style for the values they match.
- Undo (Ctrl+Z) reverses any formatting change.
Common Issues – How Formatting Works¶
Problem: Formatting commands are greyed out. - Solution: Switch to design mode and select a visual or cells. Pictures have no styles; text visuals use only the font commands.
Problem: Nothing happens when I format a selection of headings and values together. - Solution: Select cells of one part at a time – e.g. first the headings, then the values. Only Fill color works on a mixed selection.