Skip to Content

Reference

Theme fields

Every theme field the embed reads, and what the brand color paints.

The theme sets your brand once per data app. One theme styles the legacy and the v2 design, in light and dark mode. Set it in the Theming screen of your data app, or pass it on the element.

The derived brand colors, chart gradients and axis theme fields below require the plugin release that ships with this docs update ({{PLUGIN_VERSION}} or later).

Set the theme

If you use a plugin older than 0.17.0, update it to apply a saved theme’s dark mode. Choose a version.

Set theme fields in admin-theme-options on <dbn-dashboard>, or save them in a theme and load it with theme-name:

<dbn-dashboard
  token="GUEST_TOKEN"
  dashboard-id="DASHBOARD_ID"
  theme-name="Brand"
  admin-theme-options='{
    "general": { "fontFamily": "Inter" },
    "dashboard": { "ctaColor": "#4F46E5", "ctaTextColor": "#FFFFFF" },
    "cardCustomization": { "borderRadius": "12px" },
    "chart": {
      "selected": "Brand",
      "gradient": { "enabled": true, "startColor": "#4F46E5", "endColor": "#A5B4FC", "direction": "bottom" }
    }
  }'
></dbn-dashboard>

Each field you set goes on top of the named theme. A field you leave out keeps its value. Style an embed has the order the embed reads theme props in.

The brand color

Set dashboard.ctaColor and select Brand with chart.selected to derive the colors below. A saved palette named Brand keeps its own colors. The example uses #4f46e5:

What it paintsLightDark
Primary color token#4f46e5#4f46e5
Text and icons on the brand color#ffffff#ffffff
The brand color under the pointer#4433d3#5b57f7
The brand color while pressed#3c22c6#6668fd
Focus ring and selected outline#4f46e5#5e5bfa
Links and selected labels#4f46e5#7983fe
The fill of a selected row#ecefff#242849
Text on that fill#4f46e5#7d88fb
A soft brand border#c5ceff#404683
  • To choose a separate brand color for dark mode, set general.darkOverrides.dashboard.ctaColor.
  • Text on the brand color, links and labels reach a 4.5:1 contrast; lines and the focus ring reach 3:1.
  • Set dashboard.ctaTextColor for the text on the brand color. The embed adjusts text colors with low contrast. Use general.darkOverrides.dashboard.ctaTextColor to set button text for dark mode.
  • A mode with no brand color or with #18181b keeps its original colors.
  • A chart palette that starts from your brand is 8 colors: #4f46e5, #1d6c0d, #9b7e00, #e06572, #2491b2, #006d4a, #e0692e, #8949a3.

The table describes the derived theme tokens. Shared calendar controls can use their default Light colors. Style the date filter shows how to target individual date filter parts.

Brand gradient

chart.gradient fills the first series of a bar, stacked bar or row chart:

  • Set enabled to true and use hex for both colors: #rgb, #rrggbb or #rrggbbaa.
  • direction is where the end color sits: top, bottom, left or right. Not set means bottom.

In v2, either a valid enabled chart.gradient or viewer gradient editing enables saved fills on these charts. To opt in through viewer settings, set customSettings.gradients.canEdit to true and keep Chart Colors enabled. The section is enabled by default. Set chartColors.canEdit to false to disable it.

A nonempty list of saved gradient rows takes precedence. The chart skips invalid rows and applies the valid fills in order, starting with the first series. Any remaining series use palette colors. When the metric has no saved rows, the theme gradient can fill the first series. Without either opt-in, v2 charts keep their palette. Classic continues to draw its saved gradients.

Grid lines, tick marks and axis titles

Three blocks in chart.axis set the look of the axes on column, bar, stacked, line, area, combo, scatter, bubble, waterfall and time series charts. Pie, funnel, treemap, gauge, map and table do not change.

{
  "chart": {
    "axis": {
      "gridLines": "horizontal",
      "tickLines": "hide",
      "titleStyle": { "fontFamily": "Georgia, serif", "fontSize": 13, "fontWeight": 600, "fontStyle": "italic" }
    }
  }
}
FieldValuesNot set
chart.axis.gridLinesauto, horizontal, vertical, both, none. Named by the way the line runs: horizontal lines run across the chart.auto: each chart draws its own default
chart.axis.tickLinesauto, show, hide. Both axes.auto: each chart’s default
chart.axis.titleStyle.fontFamilyA font name or stack. A font in general.fonts loads first.The chart font
chart.axis.titleStyle.fontSizepx, 8 to 48. 13 and "13px" both work.14
chart.axis.titleStyle.fontWeight100 to 900 in steps of 100, normal or bold500
chart.axis.titleStyle.fontStylenormal, italicnormal

The axis title is the name beside an axis, such as “Revenue”. The chart draws it on a canvas, so CSS and ::part() cannot reach it. Use chart.axis.titleStyle for the font. The existing chart.axis.title string still holds title text.

Which setting wins, highest first:

  1. The host chart appearance. Use options.chartAppearance on a dashboard or chart-appearance on a standalone metric.
  2. The metric’s own saved setting. For grid lines and tick marks, this is also a viewer’s choice in chart settings. For the title font, only a font that differs from the builder default (14px, weight 500) counts.
  3. chart.axis in the theme.
  4. The chart’s default.

A metric that already saves its own grid line and tick switches keeps them. To force grid line visibility, set horizontalAxis.hideSplitLines or verticalAxis.hideSplitLines in the host chart appearance.

A value outside the list is ignored with one console warning, and the chart uses the next setting down. You can also set these in Settings > Theming > Chart.

To let viewers change ticks, grid lines or gradient fill, use viewer chart settings.

All theme fields

chart.axis.labels: "all" shows each category where the chart uses the theme label rule. Saved rules for intervals, zoom or rotation take priority. A long first category label can still extend beyond the chart edge.

Every field below also works inside general.darkOverrides, except the fields in general and the layout options. The embed uses those values in dark mode.

89 fields.

FieldTypeWhat it sets
general.fontFamilyfont nameFont for the whole dashboard
general.modelight or dark. For auto, set general.isSystemMode to trueLight, dark, or follow the viewer
general.datePickerFormatstringDate picker format
general.densitycomfortable, compactSpacing density
dashboard.backgroundColorcolorPage background
dashboard.metricCardColorcolorCard background
dashboard.ctaColorcolorButton color
dashboard.ctaTextColorcolorButton text
dashboard.selectBoxSizesmall, medium, largeFilter size
dashboard.selectBoxVariantfloating, staticFilter style
dashboard.selectBoxBorderRadiuspx, 0 to 24Filter corner radius
dashboard.selectBoxTextColorcolorFilter text
dashboard.horizontalGapnumber, 0 to 20Horizontal gap between cards
dashboard.verticalGapnumber, 0 to 20Vertical gap between cards
dashboard.disableDashboardMinimapbooleanHide the dashboard minimap
dashboard.filterBar.layoutinline, row, full-widthFilter bar layout
dashboard.filterBar.labelPlacementauto, above, inside, hiddenFilter label placement
dashboard.filterBar.dateRangeLabeloff, onDate range in words
cardTitle.fontWeight300, normal, 500, 600, bold, 800Card title weight
cardTitle.fontSizepx, 10 to 32Card title size
cardTitle.colorcolorCard title text
cardTitle.elementColorcolorSection title text
cardDescription.fontWeight300, normal, 500, 600, bold, 800Card description weight
cardDescription.fontSizepx, 9 to 20Card description size
cardDescription.colorcolorCard description text
cardDescription.elementColorcolorSection description text
cardCustomization.borderRadiuspx, 0 to 32Card corner radius
cardCustomization.paddingpx, 0 to 40Card padding
cardCustomization.shadownone, small, medium, largeCard shadow
cardCustomization.disableShadowOnHoverbooleanNo shadow change on hover
cardCustomization.disableStrokebooleanNo card border
cardCustomization.metricStrokeColorcolorCard border color
cardCustomization.responsiveFontScalingbooleanScale card text with width
cardCustomization.darkElevationbooleanLift cards in dark mode
chart.selectedpalette nameChart palette in use
chart.paletteOptionsarray of palette namesPalettes embed users may pick
chart.palettes[{ name, colors[] }]Chart palettes (name and colors)
chart.fontFamilyfont nameChart font
chart.fontColorcolorChart text
chart.referenceLineColorcolorReference line color (a line’s own color wins)
chart.letterSpacingpx, -2 to 6Chart letter spacing
chart.chartSettingsOverridebooleanTheme chart text wins over each metric
chart.legend.positionauto, top, bottom, right, hiddenChart legend position
chart.axis.labelsauto, allChart axis labels (all keeps every category)
chart.axis.gridLinesauto, horizontal, vertical, both, noneChart grid lines (by the direction the line runs)
chart.axis.tickLinesauto, show, hideChart axis tick marks
chart.axis.titleStyle.fontFamilyfont nameAxis title font (x and y axis names)
chart.axis.titleStyle.fontSizenumber, 8 to 48Axis title size (px)
chart.axis.titleStyle.fontWeight300, 400, 500, 600, 700, 800Axis title weight
chart.axis.titleStyle.fontStylenormal, italicAxis title style
chart.gradient.enabledbooleanBrand gradient on bar charts
chart.gradient.startColorcolorGradient start color
chart.gradient.endColorcolorGradient end color
chart.gradient.directiontop, bottom, left, rightGradient direction
chart.tooltip.header.fontFamilyfont nameTooltip header font
chart.tooltip.header.fontSizenumber, 8 to 28Tooltip header size
chart.tooltip.header.fontWeight300, normal, 500, 600, bold, 800Tooltip header weight
chart.tooltip.header.fontColorcolorTooltip header text
chart.tooltip.label.fontFamilyfont nameTooltip label font
chart.tooltip.label.fontSizenumber, 8 to 28Tooltip label size
chart.tooltip.label.fontWeight300, normal, 500, 600, bold, 800Tooltip label weight
chart.tooltip.label.fontColorcolorTooltip label text
chart.tooltip.value.fontFamilyfont nameTooltip value font
chart.tooltip.value.fontSizenumber, 8 to 28Tooltip value size
chart.tooltip.value.fontWeight300, normal, 500, 600, bold, 800Tooltip value weight
chart.tooltip.value.fontColorcolorTooltip value text
chart.tooltip.card.paddingnumber, 0 to 32Tooltip padding
chart.tooltip.card.borderRadiusnumber, 0 to 24Tooltip corner radius
chart.tooltip.card.bgColorcolorTooltip fill
chart.tooltip.card.borderColorcolorTooltip border
chart.tooltip.overridebooleanTheme tooltip wins over each metric
chart.tableSettings.header.fontColorcolorTable header text
chart.tableSettings.header.bgColorcolorTable header fill
chart.tableSettings.header.fontWeightregularfont, boldfontTable header weight
chart.tableSettings.header.fontSizenumber, 8 to 28Table header size
chart.tableSettings.content.fontColorcolorTable cell text
chart.tableSettings.content.fontWeight300, 400, 500, 600, 700, 800Table cell weight
chart.tableSettings.content.fontSizenumber, 8 to 28Table cell size
chart.tableSettings.content.lineGapsmall, medium, largeTable row spacing
chart.tableSettings.overridebooleanTheme table style wins over each metric
chart.tableSettings.autoPaginationbooleanTable pagination fits the card
dashboard.underlyingData.header.fontColorcolorUnderlying data header text
dashboard.underlyingData.header.bgColorcolorUnderlying data header fill
dashboard.underlyingData.header.fontWeightregularfont, boldfontUnderlying data header weight
dashboard.underlyingData.header.fontSizenumber, 8 to 28Underlying data header size
dashboard.underlyingData.content.fontColorcolorUnderlying data cell text
dashboard.underlyingData.content.fontWeight300, 400, 500, 600, 700, 800Underlying data cell weight
dashboard.underlyingData.content.fontSizenumber, 8 to 28Underlying data cell size
dashboard.underlyingData.content.lineGapsmall, medium, largeUnderlying data row spacing

Scheduled email reports and the PDF download take only the brand color, logo, chart palette and date format. Not supported, and why says why.

Layout fields are on Layout options. Font files are on Fonts.