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>const el = document.querySelector('dbn-dashboard');
el.options = { disableMetricCreation: true, showDashboardActions: false };- 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.
| Key | Type | Default | What it does |
|---|---|---|---|
disableMetricCreation | boolean | false | Hides metric creation for viewers. |
disableMetricUpdation | boolean | false | Viewers cannot edit metrics. |
disableMetricDeletion | boolean | false | Viewers cannot delete metrics. |
disableManageMetrics | boolean | false | Hides the manage metrics button. |
disableLayoutCustomization | boolean | false | Viewers cannot change the dashboard layout. |
disableSaveLayout | boolean | false | Hides the save button when a viewer edits the layout. |
disableScheduleEmailReports | boolean | false | Hides the schedule email reports button. |
disableUnderlyingData | boolean | false | Hides underlying data on every card. |
disableDownloadDataNoFilters | boolean | false | Blocks a data download while no filter is applied. |
disableDownloadUnderlyingDataNoFilters | boolean | false | Blocks an underlying data download while no filter is applied. |
Header and layout
| Key | Type | Default | What it does |
|---|---|---|---|
showDashboardActions | boolean | true | false hides the whole header action row. |
hideDashboardName | boolean | the dashboard’s saved setting | true hides the dashboard name. false shows it, whatever the saved setting is. |
renameBoard | string | board | Renames the saved filter views (“boards”). The first word, in lower case, replaces “board” in that menu. |
dashboardSpacing | object | none | { "verticalGap": number, "horizontalGap": number, "hide": boolean }. The gaps set the space between cards. hide: true removes Adjust Spacing from layout editing. |
dashboardPadding | string | none | CSS padding shorthand for the dashboard wrapper, for example "16px 24px". |
shouldFitFullScreen | boolean | false | Opens the metric builder and full screen views inside the embed box, not over the whole browser window. |
enableDashboardMinimap | boolean | false | Shows the dashboard minimap and progress header. |
ctaButtonCustomization | object | none | CSS for the header buttons. Keys primary, secondary, tertiary, each with styles, hoverStyles, activeStyles, disabledStyles (CSS strings). |
Cards and charts
| Key | Type | Default | What it does |
|---|---|---|---|
allowedChartTypes | string[] | all types | Chart 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. |
chartColors | string[] | admin theme colors | Series colors, any CSS color. Wins over the admin theme’s chart colors. |
chartPaletteOptions | object[] | admin theme palettes | [{ "name": string, "colors": string[] }]. The palettes a viewer can pick in chart settings. |
chartAppearance | object | none | Chart appearance for every card. Same shape as chart-appearance on <dbn-metric>. |
hideDatePickerOptions | string[] | [] | Date picker presets to hide, by label. Not case sensitive. |
hideMetricCardShadow | boolean | false | Removes the card shadow. |
disableMetricCardBorder | boolean | false | Removes the card border. Leave the key out to keep the border. |
disableMainLoader | boolean | false | Hides the dashboard loader. Also turns off the 60 second “did not load” message. |
disableMetricLoader | boolean | false | Hides the loader on each card. |
isShowNoDataFoundScreen | boolean | false | Shows one “No Data” screen when every card has no data. |
showAllChartSettings | boolean | false | Shows every chart setting in metric creation, not only the default list. |
showChartClickSettings | boolean | false | Shows the Actions tab (click actions) in metric creation. |
exportMsgPosition | string | bottom-right | Where the “exporting dashboard” message shows: bottom, bottom-left, bottom-right, center, top, top-left, top-right, or hidden. |
colorScheme | string | none | light, dark, system or theme. The color-scheme attribute wins over it. See Theme and appearance. |
enableCrossFilterBeforeDrill | boolean | false | A 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
| Key | Type | Default | What it does |
|---|---|---|---|
isModifyUrl | boolean | false | Writes applied filters and drill levels into the host page URL. |
legacyUrlState | boolean | false | With 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. |
namespaceUrlState | boolean | true | Deprecated. 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.
| Setting | What it does |
|---|---|
window.dbn.baseUrl | Backend origin for every request. Wins over the base-url attribute. |
window.dbn.proxyAuthUrl | Your proxy origin. Wins over baseUrl and base-url. Use with isEnableProxyAuth and proxyAuthKey. See Proxy authentication. |
window.dbn.geoJsonBaseUrl | Loads 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.disableMetricQueryBatch | true 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.