Skip to Content

Component Options

Set dashboard options

Turn viewer actions, layout, loaders and URL state on or off with one JSON attribute on dbn-dashboard.

options is one JSON object on <dbn-dashboard>. It holds the switches that have no attribute of their own. <dbn-metric> has no options attribute.

Set options

In HTML, write the object as a JSON string. In JavaScript, set the property to an object.

<dbn-dashboard
  token="GUEST_TOKEN"
  dashboard-id="DASHBOARD_ID"
  options='{"disableMetricCreation":true,"showDashboardActions":false}'
></dbn-dashboard>
  • A value that is not a JSON object is ignored. The console shows [databrain] <dbn-dashboard> "options" must be a JSON object, got ... The value is ignored.
  • A boolean key also accepts the strings "true" and "false".
  • Leave a key out to get its default.

All keys

Viewer actions

The guest token and the data app decide what a viewer may do. These keys can only take an action away. They never add one the token does not allow.

KeyTypeDefaultWhat it does
disableMetricCreationbooleanfalseHides metric creation for viewers.
disableMetricUpdationbooleanfalseViewers cannot edit metrics.
disableMetricDeletionbooleanfalseViewers cannot delete metrics.
disableManageMetricsbooleanfalseHides the manage metrics button.
disableLayoutCustomizationbooleanfalseViewers cannot change the dashboard layout.
disableSaveLayoutbooleanfalseHides the save button when a viewer edits the layout.
disableScheduleEmailReportsbooleanfalseHides the schedule email reports button.
disableUnderlyingDatabooleanfalseHides underlying data on every card.
disableDownloadDataNoFiltersbooleanfalseBlocks a data download while no filter is applied.
disableDownloadUnderlyingDataNoFiltersbooleanfalseBlocks an underlying data download while no filter is applied.

Header and layout

KeyTypeDefaultWhat it does
showDashboardActionsbooleantruefalse hides the whole header action row.
hideDashboardNamebooleanthe dashboard’s saved settingtrue hides the dashboard name. false shows it, whatever the saved setting is.
renameBoardstringboardRenames the saved filter views (“boards”). The first word, in lower case, replaces “board” in that menu.
dashboardSpacingobjectnone{ "verticalGap": number, "horizontalGap": number, "hide": boolean }. The gaps set the space between cards. hide: true removes Adjust Spacing from layout editing.
dashboardPaddingstringnoneCSS padding shorthand for the dashboard wrapper, for example "16px 24px".
shouldFitFullScreenbooleanfalseOpens the metric builder and full screen views inside the embed box, not over the whole browser window.
enableDashboardMinimapbooleanfalseShows the dashboard minimap and progress header.
ctaButtonCustomizationobjectnoneCSS for the header buttons. Keys primary, secondary, tertiary, each with styles, hoverStyles, activeStyles, disabledStyles (CSS strings).

Cards and charts

KeyTypeDefaultWhat it does
allowedChartTypesstring[]all typesChart types offered in full screen and in metric creation. Values: line, bar, stack, row, combo, pie, doughnut, waterfall, funnelV2, gaugeV2, singleValue, table, pivotV2, rose, horizontalStack, treeMap, progressBarV2.
chartColorsstring[]admin theme colorsSeries colors, any CSS color. Wins over the admin theme’s chart colors.
chartPaletteOptionsobject[]admin theme palettes[{ "name": string, "colors": string[] }]. The palettes a viewer can pick in chart settings.
chartAppearanceobjectnoneChart appearance for every card. Same shape as chart-appearance on <dbn-metric>.
hideDatePickerOptionsstring[][]Date picker presets to hide, by label. Not case sensitive.
hideMetricCardShadowbooleanfalseRemoves the card shadow.
disableMetricCardBorderbooleanfalseRemoves the card border. Leave the key out to keep the border.
disableMainLoaderbooleanfalseHides the dashboard loader. Also turns off the 60 second “did not load” message.
disableMetricLoaderbooleanfalseHides the loader on each card.
isShowNoDataFoundScreenbooleanfalseShows one “No Data” screen when every card has no data.
showAllChartSettingsbooleanfalseShows every chart setting in metric creation, not only the default list.
showChartClickSettingsbooleanfalseShows the Actions tab (click actions) in metric creation.
exportMsgPositionstringbottom-rightWhere the “exporting dashboard” message shows: bottom, bottom-left, bottom-right, center, top, top-left, top-right, or hidden.
colorSchemestringnonelight, dark, system or theme. The color-scheme attribute wins over it. See Theme and appearance.
enableCrossFilterBeforeDrillbooleanfalseA click on a v2 card publishes the clicked value as a cross filter before it drills. Sibling cards with drill levels use it. Needs enable-cross-filter.

URL state

KeyTypeDefaultWhat it does
isModifyUrlbooleanfalseWrites applied filters and drill levels into the host page URL.
legacyUrlStatebooleanfalseWith isModifyUrl, writes bare filter keys and drops the host page’s own query parameters. Use it only if you depend on the old URL shape.
namespaceUrlStatebooleantrueDeprecated. Namespaced URL keys are the default. Remove it from your options.

With isModifyUrl on, the embed keys its URL entries by dashboard id and keeps your own query parameters. It never writes the guest token into the URL. A bare ?Region=APAC link is read in both modes.

Page-wide settings on window.dbn

Set these on window.dbn before the first element connects. They apply to every embed on the page.

SettingWhat it does
window.dbn.baseUrlBackend origin for every request. Wins over the base-url attribute.
window.dbn.proxyAuthUrlYour proxy origin. Wins over baseUrl and base-url. Use with isEnableProxyAuth and proxyAuthKey. See Proxy authentication.
window.dbn.geoJsonBaseUrlLoads map outlines from <geoJsonBaseUrl>/usa.json, /india.json and /world.json. Not set: the outlines come from the plugin bundle, which needs no extra request.
window.dbn.disableMetricQueryBatchtrue turns off batched card queries. Each card then sends its own request.

You can also turn off batching with ?dbnMetricBatch=off in the page URL. The value stays in localStorage (@dbn:metricQueryBatch) for later visits. ?dbnMetricBatch=on turns it back on. With no setting, the embed tries a batch first and falls back to one request per card if the server does not support it.

Next: See every attribute.