Skip to main content
Version: 9.5

Single Panel Widget

Use the Single Panel widget to embed a chart, metric, or summary panel that has already been created in Qrvey Composer.

Note: Unlike Dashboards, Single Panel widgets do not include the full set of dashboard functionality such as global filters. When embedding a Single Panel widget, only the visualization itself is rendered.

Embeddable Sample

The following sample demonstrates how to embed a single panel in your system.

Important: This example is for testing purposes only.

  • API Key: Do not expose your API key in production. Use it only for communication between back ends.
  • Minimal Config: The sample uses the minimum set of properties needed for quick testing. Production deployments can require additional properties.
<an-panel config="singlePanelConfig"></an-panel>

<!-- Widget's Configuration Object -->
<script>
var singlePanelConfig = {
"apiKey": "<YOUR_PRIVATE_API_KEY>", // Testing only. Do not expose in production.
"appId": "<APP_ID>",
"domain": "https://<YOUR_QRVEY_DOMAIN>",
"userId": "<USER_ID>",
"qrveyId": "<DATASET_ID>", // Represents the dataset ID
"type": "CHART", // Can also be "METRIC" or "SUMMARY"
"chartId": "<CHART_ID>" // Use metricId if type=METRIC, summaryId if type=SUMMARY
}
</script>

<!-- Widget's Launchers -->
<script type="module" src="<WIDGETS_URL>/qrvey-an-widgets/an-dashboard/andashboard/andashboard.esm.js"></script>
<script nomodule src="<WIDGETS_URL>/qrvey-an-widgets/an-dashboard/andashboard/andashboard.js"></script>

Production Deployment

When deploying to production:

  • Use a qvToken instead of an apiKey.
  • Ensure appId, userId, and qrveyId are passed using a token, not hard-coded.
  • clientId, orgId, and orgs are not required for rendering the widget but can be provided when you want the Single Panel widget to act as a gateway for other components (such as Download Manager, Export Data modal, Subscriptions, or personalization).
  • Configure additional properties such as panel, featurePermission, and i18n as needed.
  • Keep the API key securely stored on the server side only.

Configuration Object

PropertyTypeRequiredqvToken SupportDescription
domainstringYNQrvey instance URL. Example: https://example.qrvey.com.
qvTokenstringYes if apiKey is not provided.-Encrypted token used for secure authentication. Used in production to securely pass all required parameters. Cannot be used with apiKey.
apiKeystringY (if qvToken is not provided)NSecret token for accessing the application. Caution: For testing only. Do not use in the production UI. Cannot be used with qvToken.
appIdstringYYID of the Qrvey application that contains the chart, metric, or summary panel.
userIdstringY (if not in session cookie)YID of the Qrvey Composer user that owns the application being embedded. Alternatively, it can be passed in a Qrvey session cookie.
qrveyIdstringYNRepresents the dataset ID to be used in the panel.
typestringYNDefines the panel type. Options: CHART, SUMMARY, or METRIC.
chartIdstringYes if type is CHARTNID of the chart to display.
metricIdstringYes if type is METRICNID of the metric to display.
summaryIdstringYes if type is SUMMARYNID of the summary panel to display.
clientIdstringNYNot required for rendering. Unique identifier for the tenant end user. Used for personalization and passed to other components such as Download Manager or Export modal.
orgIdstringNYNot required for rendering. ID of the organization to which the roles and users are assigned. To list the roles and users in the subscribe modal, this value should correspond to the user in the session orgId. For more information, see Exports.
orgsObject arrayNOnlyNot required for rendering. Defines users and roles grouped by organization. Used to enable sharing/subscription features in other components.
emailstringN (required for scheduling/subscriptions)OnlyEmail of the clientId user. Enables scheduling of exports/subscriptions.
panelobjectNNAllows configuration of panel features (header, body, footer, styles, and so on). For more information, Panel Object.
menuLayoutobjectNNAllows configuration of menu position in a chart panel. Options: hidden, header, floating (default: header). For more information, see floatingMenu.
userFiltersobjectNYCollection of custom filters applied to the panel visualization. For more information, see User Filters.
timezonestringNYTimezone offset applied to dates. For more information, see Configuring Time Zone Settings.
i18nobjectNNDefines language for UI text and dataset columns. Supports internationalization. For more information, see i18n Object.
themeIdstringNNTheme ID to apply a pre-defined theme. For more information, see Accessing a Theme Programmatically.
featurePermissionobjectNNEnables you to create a customized view by showing and hiding specific features. For more information, see Feature Permission Object.
customTokensobjectNNAdds personalization with custom tooltips. For more information, see Custom Tokens Example: { "my_header": "Tooltip Header" }.

Exports

Local and scheduled exports created from this widget are associated with the clientId and orgId that control their display in the Download Manager widget.

If clientId and orgId are passed through a JWT to the widget, the same JWT is sent to the export requests and considered when creating the Download Manager records, even if the widget itself does not use these properties.

Orgs

For full details on how orgs work, see Organizations, Ownership, and Subscriptions.

PropertyTypeDescription
orgIdstringID of the organization to which the roles and users are assigned. To list the roles and users in the subscribe modal, this value should correspond to the user in the session orgId
usersarrayAn object/array of users to be listed in the subscribe modal. This is not for the current user. Adjust clientId and email accordingly.
users.clientIdstringClient ID of the user.
users.emailstringEmail address of the user.

Example

const orgs = [
{
orgId: "ORG_ID",
users: [
{
clientId: "CLIENT_ID",
email: "EMAIL"
},
{
clientId: "CLIENT_ID2",
email: "EMAIL2"
}
]
}
];

i18n

For more information, see Internationalization, Step by Step.

PropertyTypeRequiredValue
langstringYLanguage to use for the UI (examples: "es", "es-ES").
localestringNLocale code to use for date and number formatting (for example, "es-ES").
currencyFormatOverridestringNAccepts currency codes and sets the currency (for example, "EUR") on visualizations and their exports. It overrides the default currency format in the application. Supports the list of ISO 4217 currency codes.

Note: Currency set directly on a column in a chart using the Values Format option supersedes the currency setting in currencyFormatOverride.

Example Configuration

var config = {  
"domain": "<DOMAIN>",
"qvToken: "<QVTOKEN>",
"i18n": {
"lang": "en",
"locale": "EN",
"currencyFormatOverride": "EUR"
}
}

Note: The i18n object is supported only in the widget configuration object. It cannot be passed in a JWT.

Timezone

PropertyTypeRequiredDescription
timezone.offsetstringNSpecifies the timezone offset. Accepted formats: +03:00, -03, and so on.

Panel

PropertyTypeRequiredDescription
panel.headerobjectNPanel header options object.
panel.header.visibleBooleanNDetermines if the panel header is visible. Defaults to true.
panel.header.draggableBooleanNUsed by Custom View and Metric View panels. If true, the panel header has an icon to drag and drop the panel. Defaults to false in embedded widgets.
panel.header.filterBooleanNDetermines if the panel header has a filter button to open the Filter Modal widget. Defaults to false in embedded widgets.
panel.header.menuarray/BooleanNIf it's an array, the panel header displays the options passed through the array. If the value is true, the panel header displays a default menu. Accepted values for the array: EDIT, DOWNLOAD, DUPLICATE, SIZE and DELETE.
Note: SIZE is used only by Custom View panels.
panel.header.fit_panelBooleanNSet to true if "fit to panel" button is enabled (false by default).
panel.header.title_prefixstringNSets a prefix for the title of the panel.
panel.header.chartSelectionBooleanNAllow the user to change the chart type.
panel.header.columnAggregationBooleanNAllow the user to select and change the columns aggregates directly from the self-service option.
panel.header.columnGroupingBooleanNAllow the user to add or remove groups in a simple or grouped table.
panel.header.columnReplacementBooleanNAllow the user to select and change the columns as the self-service option.
panel.header.columnSectionBooleanNAllow the user to add or remove sections in an expandable table.
panel.header.columnSelectionBooleanNAllow the user to add or remove columns in table charts.
panel.header.dateGroupingobjectNAllow the user to change date grouping. These items are accessible under the Column settings icon.
panel.header.externalDownloadarrayNSet of values to allow external download for defined formats. Used by the Dashboard.
Accepted Values: CSV.
panel.header.sortingBooleanNDetermines if sorting button is shown in the panel header.
panel.header.smartAnalyzerBooleanNAllow the user to access the Smart Analyzer icon from a chart header. Defaults to true when the Smart Analyzer AI Agent is enabled in the Admin Center.
panel.bodyobjectNPanel body options object.
panel.body.popupobjectNPanel body popup options object. Used to show Filter By, See Data, and Drill-Down options.
panel.body.popup.itemsarrayNSet of options to show on the popup. For more information, see panel.body.popup.items properties.
panel.body.popup.items[itemIndex]objectNPopup item options object to use in panel.body.popup.items array.
panel.body.popup.items[itemIndex].labelstringNOption name. Required for this array.
panel.body.popup.items[itemIndex].actionFunctionNCustom callback function.
panel.body.comparativeAnalysisBooleanNAllow the user to perform Comparative Analysis. Cannot be enabled in the widget if it is disabled in the chart configuration.
panel.floatingMenuobjectNControls the display of icons in a floating menu.
panel.floatingMenu.smartAnalyzerBooleanNAllow the user to access the Smart Analyzer from a floating menu. Defaults to true when the Smart Analyzer AI Agent is enabled in the Admin Center.
panel.footerobjectNPanel footer options object.
panel.footer.visibleBooleanNDetermines if a panel footer is visible. Defaults to false.
panel.stylesobjectNStyles options object. These properties extend the current theme.
panel.styles.chartsTitlestringNSet the charts title color using a hex value.
panel.styles.chartsFontFamilystringNSet the charts font family.
panel.styles.axisDataLabelsstringNSet axis labels color in charts.
panel.styles.dataLabelsstringNSets a hexadecimal color for data labels in charts.
panel.styles.valuesMainstringNSets a hexadecimal color for axis ticks values in charts.
panel.styles.chartsLegendsstringNSets a hexadecimal color for charts legends labels.
panel.styles.chartsTooltipsstringNSet a hexadecimal color for charts tooltips.
panel.styles.tableHeaderFontstringNSets color for table header texts.
panel.styles.chartsMainstringNSets color for chart data points like bars, symbols and lines.
panel.styles.themePalettearrayNSets up to 20 hexadecimal color values for chart data points like bars, symbols, and lines.

dateGrouping

// example
"dateGrouping": {
"year": true,
"quarter": true,
"month": true,
"week": true,
"quarter_only": true,
"month_only": true,
"day_only": true,
"advancedGrouping": {
"day": true,
"hour": true,
"minute": true,
"second": true,
"hour_only": true,
"minute_only": true,
"second_only": true
}
}

floatingMenu

"panel": {
  "menuLayout": "floating", // "hidden" | "header" | "floating"
  "header": {
      "menu": ["EDIT","SIZE"],
  },
  "floatingMenu": {
    "edit": false,
    "duplicate": false,
    "delete": false,
    "download": {
      "jpg": false,
      "pdf": true,
      "excel": false,
      "csv": false,
      "csv-summary": true
      },
    "columnGrouping": true,
    "columnSelection": true,
    "columnSection": true
    },
   }

panel.body.popup.items

Accepted array items format:

let item = {
label: '<popup_item>', // Required
action: customCallbackFunction(), // Optional
customdrills: <Array> // Optional
}

Example: [{ label: 'SEEDATA' }, { label: 'FILTERBY' }, { label: 'DRILLDOWN' }, { label: 'CUSTOMDRILL' }]

Feature Permission

PropertyTypeRequiredDescription
downloadsobjectNHide the Export feature, which supports exporting charts, tables, dashboards, and reports to downloadable files (PDF, JPG, CSV, EXCEL, CSV SUMMARY). For single panel, contains hideSchedule.
downloads.hideScheduleBooleanNIf true, hide the Schedule option in the Export feature (default: false).
featurePermission.hideSubscriptionBooleanNHide the subscription option in the export modal.
featurePermission.hideSubscribeExternalUsersBooleanNDisable the option of subscribing users outside of the organization.

Styles

The Single Panel Widget supports customization through CSS variables, allowing you to adapt the look and feel of dashboards to match your application’s design system. This includes control over fonts, colors, spacing, and other UI elements.

By overriding the available style variables, you can achieve a fully branded experience for end users without altering functionality. This is recommended to ensure consistency across embedded dashboards.

For the complete list of available style variables and examples of how to use them, see Customize Widgets Using CSS.