Skip to main content

What’s New

Qrvey 8.7
Version 8.7 of the Qrvey platform is now available to customers! This version includes new features including area charts, the ability to pivot and export data, as well as numerous bug fixes and performance improvements.
Learn More
Qrvey 8.6
Version 8.6 of the Qrvey platform is now available to customers. This version includes several new feature enhancements and performance improvements.
Learn More
Required Update for 8.5.1
Attention 8.5.1 customers: for any 8.5.1 instance deployed prior to 08/05/2024, an update is required to ensure you are running the latest images.
Learn More
Qrvey 8.5
Version 8.5 (LTS) of the Qrvey platform is now available to customers. This version includes several new features and performance improvements.
Learn More
End-of-life Schedule
We've added a new article that lists the features and endpoints that have been scheduled for deprecation. All features and endpoints will be supported for (1) year after the release date of the LTS version that contains the alternative.
Learn More
Version: 8.0

Single Panel Widget

This widget allows the user to display a chart, metric or summary panel that has been created previously, through a configuration object where properties are set to define some options and behaviors for the panel.

To obtain the specific configuration object for your environment, go to the Analyze tab for the desired dataset and choose the Summary, Metric, or Custom view option from the menu. You can find the Embed Chart command under the three-dot menu of any panel that you wish to embed. Find and copy the necessary widget configuration code from the dialog that opens upon clicking the option. The code includes all of the necessary properties, including the “domain”, “app_id” and “user_id” property values. You have to provide the unique API key value before including the code in your application.

The building blocks of the code are explained below:

HTML Tag And Launcher

The HTML tag for this widget is:

<an-panel config=...>

Note: The configuration property for this widget is called “config”, unlike in most of the other widgets where the same property is called “settings”.

This widget needs an extra script for proper support in all browsers:

<script type="module" src=”https://<WIDGETS_URL>/qrvey-an-widgets/an-dashboard/andashboard/andashboard.esm.js”></script> (For all browsers support)

<script nomodule src=”https://<WIDGETS_URL>/qrvey-an-widgets/an-dashboard/andashboard/andashboard.js”></script> (Widget launcher)

Configuration Object

The table below provides general information about each property of this widget’s configuration object along with a description of the expected value. The Required column indicates whether the property is required for the configuration object to work properly.

PropertyValueRequired
api_keyString, secret identification token to access the application.Yes
app_idString, Qrvey application ID where chart builder is being accessed from.Yes
user_idString, ID of the user that is accessing chart builderYes
domainString, domain URL in which the application is in.Yes
qrveyidString, ID of the dataset being used.Yes
typeString, type of the panel.
Accepted values:
CHART
METRIC
* SUMMARY
Yes
chart_idString, ID of the chart to display. Required if type is CHART.Yes
metric_idString, ID of the metric to display. Required if type is METRIC.Yes
summary_idString, ID of the summary panel to display. Required if type is SUMMARY.No
summary_typeString, column type. Optional for summary panels.No
panelObject, panel options object.No
panel.headerObject, panel header options object.No
panel.header.visibleBoolean,determines if the panel header is visible. The default setting is true.No
panel.header.draggableBoolean, determines if the panel header has an icon to drag and drop the panel. Used by Custom View and Metric View.No
panel.header.filterBoolean, determines if the panel header has a filter button to open the Filter Modal widget.No
panel.header.menuArray/Boolean, if it's an array, the panel header will show the options passed through the array. If the value is true, the panel header will show a default menu.
Accepted values for the array: EDIT, DOWNLOAD, DUPLICATE, SIZE and DELETE
(Note: SIZE is used only by the Custom View)
No
panel.header.fit_panelBoolean, set if fit to panel button is enabled. False by default.No
panel.header.title_prefixString, prefix for the title of the panel.No
panel.header.externalDownloadArray, set of values to allow external download for defined formats. Used by Page Builder and End User.
Accepted values: CSV
No
panel.bodyObject, panel body options object.No
panel.body.popupObject, panel body popup options object. Used to show Filter By, See Data and Drill-Down options.No
panel.body.popup.itemsArray, set of options to show on the popup. Description of properties are below.
Accepted array items format: {
label: '<popup_item>', // Required
action: <customCallbackFunction()> // Optional
customdrills: <
}
Usage example: [
{ label: 'SEEDATA' },
{ label: 'FILTERBY' },
{ label: 'DRILLDOWN' },
{ label: 'CUSTOMDRILL' }
]
No
panel.body.popup.items[itemIndex]Object, popup item options object to use in panel.body.popup.items array.No
panel.body.popup.items[itemIndex].labelString, option name. Required for this array.No
panel.body.popup.items[itemIndex].actionFunction, custom callback function.No
panel.body.popup.items[itemIndex].drilldownsArray, set of column objects. Used by End-Users.No
panel.body.popup.items[itemIndex].customdrillsArray, set of objects with chart ids, names and other properties. Used by End-Users.No
panel.footerObject, panel footer options object.No
panel.footer.visibleBoolean, determines if a panel footer is visible. The default setting is false.No
page_idString, ID of the page that contains the panel. Required only on Page Builder and End-User.No
tab_idString, ID of the tab that contains the panel. Required only on Page Builder, Report Builder and End User.No
modelObject, dataset model previously defined.No
panel_viewString, name of the view that contains the panel. Required only on Analyze section.
Accepted values: `ANALYZE
ANYWHERE`
filterDataObject, set of previously defined filters to be applied in the panel.
{logic: <Logic Key Structure>}
No
userFiltersObject, the filters object generated by the user. These filters and filterData filters are applied together.
{filters: <Filters Key Structure>}
No
idString, custom ID for the panel element.No
dataObject, internal chart or metric data configuration previously defined. Used by Chart Builder widget to show the preview panel.No
inBuilderBoolean, determines if the panel is the preview on Chart Builder.No
drilldownsObject, drilldowns object previously defined. Used by Custom View and Page Builder.No
customdrillsArray, set of customdrill objects previously defined. Used by End-User.No
clickableBoolean, determines if the panel has click events. Used by End User.No
themeidString, theme ID to use in the componentNo
panel.stylesObject, styles options object. These properties will extend from the current themeNo
panel.styles.chartsTitleString, set the charts title colorNo
panel.styles.chartsFontFamilyString, set the charts font familyNo
panel.styles.axisDataLabelsString, set axis labels color in chartsNo
panel.styles.dataLabelsString, color for data labels in chartsNo
panel.styles.valuesMainString, set color for axis ticks values in chartsNo
panel.styles.chartsLegendsString, color for charts legends labelsNo
panel.styles.chartsTooltipsString, color for charts tooltipsNo
panel.styles.tableHeaderFontString, set color for table header textsNo
panel.styles.chartsMainString, set color for chart data points like bars, symbols and lines.No
panel.styles.themePaletteArray, contains a maximum 20 color for char data points like bars, symbols and lines.No

Note: Refer to the FAQs if you don’t know where to find any of the required configuration properties.

Samples

The following samples show the way this widget is used in an HTML page. Please note that the example may not include the non-required properties of the configuration object.

You can copy and paste this code to your application, after replacing the red values with your own valid values, in order to see the embedded widget in action.

Basic Sample

<an-panel config="anpanelConfig"></an-panel>

var anpanelConfig = {
"api_key": "<API_KEY>",
"app_id": "<APP_ID>",
"domain": "https://your_qrvey_domain",
"user_id": "<USER_ID>",
"qrvey_id": "<QRVEY_ID>",
"type": "CHART",
"chart_id": "<CHART_ID>",
"panel": {
"header": {
"menu": ["DOWNLOAD"]
},
"body": {
"popup": {
"items": [
{ "label": "FILTERBY" },
{ "label": "DRILLDOWN" }
]
}
}
}
}
</script>
<!-- your launcher js link (replace with your js link) -->
<script type="module" src="https://<WIDGETS_URL>/your_qrvey_an_widgets_container/an-dashboard/andashboard/andashboard.esm.js"></script>
<script nomodule src="https://<WIDGETS_URL>/your_qrvey_an_widgets_container/an-dashboard/andashboard/andashboard.js"></script>

See the widget in CodePen:

Sample with the filters object generated by a user:

<an-panel config="anpanelConfig"></an-panel> <button onClick="applyNewFilter()">Apply other filter</button>

<script>
var anpanelConfig = {
"api_key": "<API_KEY>",
"app_id": "<APP_ID>",
"domain": "https://your_qrvey_domain",
"user_id": "<USER_ID>",
"qrvey_id": "<QRVEY_ID>",
"type": "CHART",
"chart_id": "<CHART_ID>",
"panel": {
"header": {
"menu": ["DOWNLOAD"]
},
"body": {
"popup": {
"items": [
{ "label": "FILTERBY" },
{ "label": "DRILLDOWN" }
]
}
}
},
"userFilters": {
"filters": [{
"operator": "AND",
"expressions": [
{
"enabled": true,
"questionid": "<QUESTION_ID>",
"validationType": "<VALIDATION_TYPE>",
"value": [
"<VALUE_TO_FILTER_1>"
]
}
]
}]
}
}
</script>
<script>
function applyNewFilter() {
window.dispatchEvent(new CustomEvent('anApplyUserFilters', {
detail: {
"filters": [{
"operator": "AND",
"expressions": [
{
"enabled": true,
"questionid": "<QUESTION_ID>",
"validationType": "<VALIDATION_TYPE>",
"value": [
"<VALUE_TO_FILTER_2>"
]
}
]
}]
}
}));
}
</script>
<!-- your launcher js link (replace with your js link) -->
<script type="module" src="https://<WIDGETS_URL>/your_qrvey_an_widgets_container/an-dashboard/andashboard/andashboard.esm.js"></script>
<script nomodule src="https://<WIDGETS_URL>/your_qrvey_an_widgets_container/an-dashboard/andashboard/andashboard.js"></script>

See the widget in CodePen: