Skip to content

Formatting

Formatting is intentionally allowlisted. Do not pass arbitrary Tableau style attributes through JSON. Use the supported formatting rules, color palettes, text runs, zone styles, animation settings, and custom themes below. Anything outside these tables should be treated as missing until a fixture proves it.

Worksheet Formatting Rule

Worksheet formatting lives on worksheets[].formatting[].

{
  "formatting": [
    {
      "element": "header",
      "formats": [
        {
          "attr": "font-weight",
          "value": "bold"
        },
        {
          "attr": "font-size",
          "value": 12
        }
      ]
    }
  ]
}
Field Type Required Values Description
element string Yes See element matrix Tableau style-rule target.
formats array Yes One or more style format objects Style attrs applied to the element.

Style Format Object

Field Type Required Values Description
attr string Yes See attribute matrix Style attribute.
value boolean, integer, number, or string Yes Depends on attr Value validated and normalized by the compiler.
class string No Non-empty Tableau class selector. Requires selector support for the target attr.
data_class string No Non-empty Emits Tableau data-class selector.
field string or shelf item No Field ref, aggregate, or date part Field selector. Must reference a field already on Rows or Columns.
id string Refline/refband only Authored reference ID Required for refline and refband formatting.
scope string Some attrs cols, rows Axis/table/worksheet scope selector.

Element Attribute Matrix

element Supported attr values
axis, axis-title Base attrs plus auto-subtitle, display, display-field-labels, height, line-pattern-only, line-visibility, subtitle, tick-color, title, width
cell Base attrs plus height, text-format
header Base attrs plus height, width, band-color
pane Base attrs plus band-color, aspect, minwidth, minheight, maxwidth, maxheight
worksheet Base attrs plus display-field-labels
table Base attrs plus band-level, band-size, break-on-special, omit-on-special, show-null-value-warning
mark Base attrs plus stroke-color, has-stroke, mark-transparency, size, shape, mark-labels-show, mark-labels-cull, mark-labels-line-first, mark-labels-line-last, mark-labels-range-min, mark-labels-range-max, mark-labels-mode, mark-labels-range-scope, mark-labels-range-field
label color, display, font-family, font-size, font-style, font-weight, text-align, text-format, text-orientation
datalabel color-mode, font-family, font-weight
legend background-color, col-width, font-family
field-labels font-family, font-weight
field-labels-decoration font-weight
gridline line-pattern-only, line-visibility
table-div div-level, line-visibility, stroke-color, stroke-size
header-div line-visibility, stroke-size
zeroline line-visibility
quick-filter background-color, border-color, border-style, border-width
title background-color
refline color, stroke-color, stroke-size, fill-above, fill-below, text-align, vertical-align, text-format
refband palette, reverse-palette
map map-style, washout
map-data-layer palette

Base attrs are background-color, border-color, border-style, border-width, color, font-family, font-size, font-style, font-weight, halign, mark-color, opacity, and text-align.

Attribute Value Types

Attrs Value type Values
background-color, border-color, color, mark-color, stroke-color, tick-color string Hex color #RRGGBB.
band-color, fill-above, fill-below string Hex color #RRGGBB or alpha hex #RRGGBBAA.
auto-subtitle, break-on-special, display, display-field-labels, has-stroke, mark-labels-*, omit-on-special, reverse-palette, show-null-value-warning boolean true, false.
band-level, div-level integer Non-negative integer.
band-size, border-width, col-width, font-size, height, stroke-size, width integer Positive integer, except zone-style border widths allow 0.
opacity integer 0 to 100.
mark-transparency integer Tableau mark transparency integer. Fixture evidence uses values such as 206.
size, aspect, minwidth, minheight, maxwidth, maxheight, washout number Numeric value validated by the compiler for the target attr.
halign, text-align string left, center, right.
vertical-align string top, middle, bottom.
border-style string none, solid.
font-style string normal, italic.
font-weight string normal, bold.
line-pattern-only string solid, dashed, dotted.
line-visibility string on, off.
mark-labels-mode string all, range.
mark-labels-range-scope string pane.
mark-labels-range-field string auto or generated Tableau field token, depending on fixture surface.
shape string :filled/circle.
text-orientation integer 0, -90.
color-mode string auto.
map-style string light.
map-data-layer.palette string tableau-map-blue-green-light.
refband.palette string gray80.
font-family, subtitle, title, text-format string Non-empty string except subtitle and title may be empty where Tableau needs a blank generated format.

Selector Rules

Selector Allowed Use
scope axis, axis-title, table banding attrs, and worksheet field-label visibility. Values are cols or rows.
field Selector for shelf fields. The referenced field must already be on Rows or Columns.
class, data_class Low-level Tableau selectors for proven fixture cases.
id Required for refline and refband; must match an authored reference line/distribution/band ID.

Axis formatting example:

{
  "element": "axis",
  "formats": [
    {
      "attr": "title",
      "field": {
        "field": "[Orders].[Sales]",
        "aggregation": "sum"
      },
      "scope": "cols",
      "value": "Revenue"
    },
    {
      "attr": "tick-color",
      "scope": "cols",
      "value": "#333333"
    }
  ]
}

Table, cell, and mark examples:

[
  {
    "element": "table",
    "formats": [
      {
        "attr": "band-level",
        "scope": "rows",
        "value": 0
      },
      {
        "attr": "band-size",
        "scope": "rows",
        "value": 1
      }
    ]
  },
  {
    "element": "cell",
    "formats": [
      {
        "attr": "text-format",
        "field": {
          "field": "[Orders].[Sales]",
          "aggregation": "sum"
        },
        "value": "c\"$\"#,##0;(\"$\"#,##0)"
      }
    ]
  },
  {
    "element": "mark",
    "formats": [
      {
        "attr": "mark-color",
        "value": "#4A76A1"
      },
      {
        "attr": "mark-labels-show",
        "value": true
      },
      {
        "attr": "mark-labels-mode",
        "value": "all"
      }
    ]
  }
]

Reference-line formatting example:

{
  "element": "refline",
  "formats": [
    {
      "id": "sales-average",
      "attr": "stroke-color",
      "value": "#E15759"
    },
    {
      "id": "sales-average",
      "attr": "stroke-size",
      "value": 2
    }
  ]
}

Color Palettes

Categorical Palette

Field Type Required Values Description
kind string Yes categorical Palette kind.
members array Yes Palette member objects Explicit member colors.
members[].value string, number, or boolean Yes Member value Raw field member.
members[].color string Yes #RRGGBB Member color.
{
  "field": "[Orders].[Segment]",
  "palette": {
    "kind": "categorical",
    "members": [
      {
        "value": "Consumer",
        "color": "#4E79A7"
      },
      {
        "value": "Corporate",
        "color": "#F28E2B"
      }
    ]
  }
}

Continuous Palette

Field Type Required Values Description
kind string Yes continuous Built-in continuous palette.
name string Yes blue_10_0, orange_blue_diverging_10_0, red_black_10_0, tableau-orange-blue Tableau palette name.
min number No Any number Lower color bound.
max number No Any number Upper color bound.
center number No Any number Diverging center.
steps integer No >= 2 Number of color steps.

Custom Continuous Palette

Field Type Required Values Description
kind string Yes custom_continuous Custom palette kind.
palette_type string No ordered_diverging Tableau palette type.
colors array Yes 2 to 32 hex colors Ordered color stops.
min, max, center, steps number/integer No Same as continuous palette Optional quantitative bounds.
{
  "field": "[Orders].[Profit]",
  "aggregation": "sum",
  "palette": {
    "kind": "custom_continuous",
    "palette_type": "ordered_diverging",
    "colors": ["#B2182B", "#F7F7F7", "#2166AC"],
    "center": 0,
    "steps": 10
  }
}

Dashboard Zone Styles

Dashboard style objects use snake_case JSON keys and compile to Tableau zone-style formats. They are separate from worksheet formatting.

Style object Supported fields
dashboard.style border_color, border_style, border_width, margin, margin_top, margin_bottom
dashboard.title_style border_color, border_style, border_width, margin, margin_bottom, padding
dashboard.subtitle_style font_size
filter_controls[].style background_color, border_color, border_style, border_width, margin, padding
parameter_controls[].style background_color, border_color, border_style, border_width, margin, margin_right, padding
color_legends[].style border_color, border_style, border_width, margin, padding
text_boxes[].style background_color, border_color, border_style, border_width, margin, margin_left, margin_right, padding
images[].style border_color, border_style, border_width, margin
navigation_buttons[].style, download_buttons[].style background_color, border_color, border_style, border_width, font_color, font_name, font_size, bold, italic, underline
Layout worksheet.style border_color, border_style, border_width, margin, margin_top, margin_right, margin_bottom, margin_left, padding
Layout container.style background_color, border_color, border_style, border_width, margin, margin_top, margin_bottom, padding, padding_top
Layout container.container_style background_color, border_color, border_style
Layout blank.style border_color, border_style, border_width, margin
Worksheet parameter_cards[].style background_color, border_color, border_style, border_width

Shared value rules:

Field family Values
*_color, background_color, border_color, font_color Hex color #RRGGBB, except container_style.background_color may use alpha hex.
border_style none, solid.
border_width, margin*, padding* Non-negative integer.
font_size Positive integer.
bold, italic, underline Boolean.
{
  "filter_controls": [
    {
      "worksheet": "Sales by Category",
      "field": "[Orders].[Category]",
      "style": {
        "background_color": "#F5F5F5",
        "border_color": "#000000",
        "border_style": "none",
        "border_width": 0,
        "margin": 4,
        "padding": 0
      }
    }
  ]
}

Animation

Animation can be set at workbook level with top-level animation or per worksheet with worksheets[].animation.

Field Type Required Values Description
enabled boolean No true, false Enables or disables animation.
duration_seconds number No > 0 Animation duration in seconds.
style string No phased Desktop-proven animation style.
{
  "animation": {
    "enabled": true,
    "duration_seconds": 0.5,
    "style": "phased"
  }
}

Custom Theme

Workbook themes are packaged JSON theme files. See Packaging And Validation for package assets.

Field Type Required Values Description
kind string Yes custom Theme kind.
member string Yes Root-level .json package member Must match a package.assets[].member, for example theme.json.
{
  "package": {
    "assets": [
      {
        "source": "assets/theme.json",
        "member": "theme.json"
      }
    ]
  },
  "workbook_theme": {
    "kind": "custom",
    "member": "theme.json"
  }
}