Embedding a portlet (graphic or other element) in a web page

Last modified by Aurelie Bertrand on 2026/06/22 14:34


In this documentation, we are working within the following context:

  • Server name: ddsrv
  • Port: 8080
  • DigDash domain: ddenterpriseapi
  • DigDash dashboard domain: digdash_dashboard

You will, of course, need to adapt the integration to your own environment.

💡 You can also use a server-side authentication mechanism to avoid having to use a username and password. See the page URL anonymisation for further details.
In this case, the authToken parameter replaces the pass parameter.

iFrame integration mode

ℹ In iFrame mode, only a graphical portlet (Flow) can be embedded. Other portlets (filters, legend, comments, etc.) cannot be embedded.

You can embed a chart (Flow) from your information portfolio into an iframe using a URL in the following format:

http://ddsrv:8080/ddenterpriseapi/viewflow?flowId=<flowid>

You can easily obtain the URL for a flow from the flow management panel in Studio. To do this, right-click on the flow and select ‘Copy flow URL’.

Copy flow url

For example:

http://ddsrv:8080/ddenterpriseapi/viewflow?flowId=15455f95

It is possible to pass parameters in this URL, which will be read by the application to authenticate and customise the content displayed.
These parameters are added as a query string at the end of the URL, after a question mark help.
Each parameter is a key=value pair, and the different pairs are separated by an ampersand (&).
See the section Available parameters for a list of parameters.

For example, to display the graph using:

  • username15455f95
  • the username ‘user1’ and the password ‘pass1’
  • the filter bar disabled

we embed the code in the iFrame tag as follows:

<iframe src="http://ddsrv:8080/ddenterpriseapi/viewflow?flowId=15455f95&user=user1&pass=pass1&hideFilters=true"></iframe>

Available parameters

The parameters available for charts (flows) are as follows:

ParameterValueDescription

flowId

flowId

ID of the flow to be displayed
useruserUser to authenticate
passpasswordPassword for the unauthenticated user
authTokentokenToken for the unauthenticated user
hideFilterstrue|falseHides (true) or displays (false) the filter bar
variableNamevariableValueSpecifies the value of the variable variableName

dimensionName

If the dimension contains one or more hierarchies, you can select the desired hierarchy and level by adding:

  • HDimensionName
  • LDimensionName

filterValue

yyyy

Hierarchy Name Hierarchy Level

Specifies the filtered dimension member

zzzzzzz

Specifies the name of the hierarchy
Specifies the level of the hierarchy

Embedded JavaScript integration mode

ℹ In this mode, in addition to charts, you can embed other types of elements: filters, legends, comments, measure selectors, variables, search and filtered elements.

This mode requires you to load the JavaScript file that enables a DigDash dashboard to be displayed on a web page. To do this, add the following line of code to the <head>section of your web page:

<script src="http://ddsrv:8080/digdash_dashboard/digdash.dashboard.js">

You can embed a DigDash dashboard either in HTML using dedicated tags, or via JavaScript for a more dynamic configuration.

HTML integration

A custom <DD-portlet/> tag allows you to embed a chart (Flow) or other embeddable element directly into the HTML code, without writing any JavaScript. This method is useful for simple pages or where JavaScript is not permitted.

💡In this case, authentication takes place just once within the first<dd-portlet/> tag on the page. This can be any type of portlet.

Chart (flow)

To embed a chart, use the code in the following format at the desired location on the web page:

<dd-portlet type="flow" flowId="flowId"/>

In this mode, the parameters are passed directly as tag attributes. See the section Available parameters for the full list.

For example, to display a graph with:

  • ID15455f95
  • the header hidden
  • key facts disabled

we use the following code:

<dd-portlet type="flow" flowId="flowId" showheader="false" highlightdata="false"/>

If we incorporate authentication:

<dd-portlet user="user1" pass="pass1" type="flow" flowId="flowId" showheader="false" highlightdata="false"/>

Other elements (filters, captions, etc.)

Using the same principle, it is possible to integrate other types of elements (portlets): filters, legends, comments, measure selectors, variables, search and filtered elements.
To do this, use the following general syntax:

<dd-portlet type="typeDuPortlet" parameterId="value"/>
// parameterID for the other parameters according to the type

See the section Available parameters for the full list.

For example, for a ‘Dimension’ filter-type content:

<dd-portlet type="dimension" dim="Type of line" datasource="Telecom" viztype="SlicerHorizontal" showsearch="false" showborder="false"/>
// dim : Dimension name
// datasource : Datasource name
// viztype: Vizualization type: here, horizontal list
// showsearch : Display search box
// showborder : Display border

JavaScript integration

Chart (flow)

To embed a chart using JavaScript:

  1. Add a<div> tag with a unique identifier at the desired location on the web page: this tag will act as a container for displaying the chart.
    For example:
<div id="tableflow"></div> //  tableflow is the identifier (divId)
  1. Add the JavaScript script to initialise and display the chart.
    To do this, within a <script> tag, add the following code:
DigDash.init({
"url":"http://ddsrv:8080/digdash_dashboard",
"user": "user",
"pass": "pass"
});

DigDash.drawPortlet("divId",{
"type": "flow",
"flowId": "flowId"
});
  • TheDigDash.init() method allows you to initialise the dashboard by specifying the DigDash server URL and the authentication parameters.
  • The DigDash.drawPortlet()method displays the element (portlet) with the specified parameters in the container defined previously. See the section Available Parameters for the full list.

💡 Don’t forget to call the draw() function in the body:

<body onload="draw()">

For example, to display a chart (divId = columnflow), we use the following script:

<script>
function draw() {
  // Initializing connection to DigDash server
  DigDash.init({
    "url": "https://ddsrv:8080/digdash_dashboard/",
    "user": "user",
    "pass": "pass"
  });

  //Displaying column chart
  DigDash.drawPortlet("columnflow", {
    "type": "flow",
    "flowId": "22a0cc0d",
    "showborder": false,
    "showheader": false
  });
}

Other elements (filters, legends, etc.)

Using the same principle, it is possible to integrate other types of elements (portlets): filters, legends, comments, measure selectors, variables, search and filtered elements.
To do this, use the following general syntax:

DigDash.drawPortlet("divId", {
  type: "portletType",
  // otther parameters according to portlet type
});

See the section Available parameters for the full list.

For example, to display a chart (div id = columnflow) and the associated legend (div id = legend), we use the following script:

<script>
function draw() {
  // Initializing connection to DigDash server
  DigDash.init({
    "url": "https://ddsrv:8080/digdash_dashboard/",
    "user": "user",
    "pass": "pass"
  });

  // Displaying column chart
  DigDash.drawPortlet("columnflow", {
    "type": "flow",
    "flowId": "22a0cc0d",
    "showborder": false,
    "showheader": false
  });

  // Legend associated to the column chart
  DigDash.drawPortlet("legend", {
    "type": "legend",
    "flow": "22a0cc0d",
    "showborder": false,
    "showheader": true,
    "layout": "horizontal"
  });
}

Available parameters

Parameters common to all elements (portlets)

These parameters are available for both charts and other elements.

ParameterValueDefault valueDependencyDescription
type

"flow"
"filter"
"globalfilter"
"legend"
"comment"
"text query"
"measure selector"
"dimension"
"measurefilter"
"variable"

None
parameter required
Portlet type:
  • "flow": chart (Flow)
  • "filter": filtered items
  • "globalfilter": search
  • "legend": legend
  • "comment": comments
  • "text query": data query
  • "measure selector": measure selector
  • "dimension": dimension filter
  • "measurefilter": measure filter
  • "variable": variable
subtypeflow_datamodelwrapper.xmlNone Used to define a subtype for flows
nameStringNone Name of the portlet to be displayed in the header
colourHexadecimal valueNone Portlet background colour
imagePath to the imageNone Portlet background image
showborderBoolean"true" Displays a border around the portlet
showheaderBoolean"true" Displays a header above the portlet
maximiseBoolean"false" Allows the portlet to be maximised in the Dashboard
cssstyleCSS classnone Allows you to apply CSS to this portlet
cssContent of the CSS classnoneThe CSS style `
` must exist
Contents of the CSS class
descriptionStringnone Allows context-sensitive help to be displayed via an icon on the portlet

Graphics-specific parameters (flows)

ParameterValueDefault valueDependencyDescription
highlightdataBoolean"true" Show highlights
flowdetail"auto" or flowid"false" Show flow details
displaycommenticonBoolean"false" Show an icon when a comment is present
displaylegendiconBoolean"false" Display an icon that shows the legend when clicked
layoutlegend"horizontal" or "vertical""vertical"displaylegendicon must be set to trueLegend display type: horizontal or vertical
displayaxisnamelegendBoolean"false"displaylegendicon must be set to trueShow the axis title
menuBoolean"true" Show the button to open the menu
exportCSVBoolean"true"The menu must be set to trueEnable CSV export from the menu
exportPDFBoolean"true"menu must be set to trueEnable PDF export from the menu
exportPPTBoolean"true"menu must be set to trueEnable PPT export from the menu
exportXLSBoolean"true"menu must be set to trueEnable Excel export from the menu
exportXLSWithoutStylesBoolean"true"menu must be set to trueEnable Fast Excel export from the menu
menuinfoBoolean"true"menu must be set to trueEnable the display of information from the menu

Content-specific settings Filtered items

ParameterValueDefault valueDescription
displaydimensionBoolean"false"Display the dimension name
displayhierarchyBoolean"false"Show the hierarchy name
displaylevelBoolean"false"Display the level name

Content-specific parameters Search

ParameterValueDefault valueDependencyDescription
flowsA comma-separated list of flow identifiersNoneThe flows (charts) must exist on the pageAllows you to display only members of the Flow dimensions with the specified ID
labelTextNone Allows you to change the label ‘Search’

Content-specific settings Caption

SettingValueDefault valueDependencyDescription
displayaxisnameBoolean"true" Display the axis title
layout"horizontal" or "vertical""vertical" Legend display type: vertical or horizontal
flowflowidNone The context of the legend will be determined by this Flow
hideelement"true"Noneselectelement must not be definedDisplays an icon that allows the element to be hidden on click
selectelement"true"Nonehidelement must not be definedDisplays an icon that allows the element to be selected on click
sorttype0 or 1Nonesortreverse must be set0 = Alphabetical sort, 1 = Numerical sort
sortreversebooleanNonesorttype must be definedSort in ascending or descending order

Content-specific parameters Comments

ParameterValueDefault valueDependencyDescription
datamodelsA comma-separated list of data model identifiersNoneThe data models must exist on the pageShow only comments on data models with the specified identifier
flowsComma-separated list of flow identifiersNoneThe flows (charts) must exist on the pageShow only comments on flows (graphs) with the specified ID
displaytype"displaytypelist" or "displaytypetext"None Comment display type: List or Text
filtertype"all" or "lastdays" or "lastcomments""all"must have a "filter" parameterComment filtering option: All, last X days or last X comments
filterNumericNonefiltertype must be different from "all"Comment filtering settings: X number of days or comments
displayallcommentsBoolean"false" Show all comments

Content-specific settings: Documents

ParameterValueDefault valueDependencyDescription
searchboxBoolean"true" Show search field
serverServer IDNone
parameter required

ID or name of the document server to query

Content-specific parameters Measure selector

ParameterValueDefault valueDependencyDescription
flowsA comma-separated list of flow identifiersNone
parameter required
Flows (charts) on which to base the metric selector
viztype"list", "combo" or "checkbox""list" Visualisation type of the metric selector: List, Drop-down list or Checkboxes
vizlayout"vertical" or "horizontal""vertical"No effect in the case of a drop-down list (combo box)Display type: Vertical or not
multiselectBoolean"true" Allow multiple selection

Filter-specific parameters Dimension

ParameterValueDefault valueDependencyDescription
dimDimension nameNone
parameter required
Dimension name
datasourceData model identifierNone
parameter required
Data model identifier
viztype"SlicerOneByOne"
"Slicer"
"SlicerHorizontal"
"SlicerCombo"
"SlicerSlider"
"SlicerDatePicker"
"SlicerCheckBox" "SlicerComboRange"
"SlicerTree"
"SlicerMatch"
SlicerCheckBoxRequired parameter. Available types depend on the nature of the dimensionFilter display type:
  • One by one
  • Vertical list
  • Horizontal list
  • Drop-down list
  • Slider
  • Calendar
  • Tick box
  • Min/max list
  • Tree list
  • Ruler
FlowsList of flow identifiers separated by commas The flows (charts) must exist on the pageChart(s) to which the filter will be applied
hierarchyName of the hierarchyNoneThe dimension must be hierarchicalFilter by hierarchy
levelLevel nameNoneThe dimension must be hierarchicalFilter by level
dimlabel${dimension}, ${hierarchy} or ${level},
can be used together, separated by '/'
${dimension}The dimension must be hierarchical
${hierarchy} or ${level}
Change the display of the dimension name
authorizereversefilterBoolean"false" Allow exclusion of members
multiselectBoolean"true" Enable multiple selection when selecting an item
forbidmultiselect "false""muliselect" must be set to falseDisable multiple selection
filteronsinglememberBoolean"false" Filter on a single element
authorisechange levelBoolean"false"On a hierarchical dimensionAllow level change
showsearchBoolean"true"On a continuous dimensionShow the search box
forbidemptyselectionBoolean  Prohibit empty selection
hidemptyBoolean  Hide empty values
rangeBoolean"false"On a continuous dimensionAllows you to filter all values within a range
minminNonerange must be set to trueThe minimum of the range
maxmaxNonerange must be set to trueThe maximum of the interval
filter"first" "last"None Filter by the first or last element
sorttype0 or 1Nonesortreverse must be specified0 = Alphabetical sort, 1 = Numerical sort
sortreverseBooleanNonesorttype must be definedSort in ascending or descending order

Filter-specific parameters Measure

ParameterValueDefault valueDependencyDescription
measurenameMeasure nameNone
parameter required
Name of the measure to filter
flowsList of flow identifiers separated by commasNone
parameter required
Flows (charts) affected by this filter
hidemeasurenameBoolean"false" Hide the measure name

Filter-specific parameters Variable

ParameterValueDefault valueDependencyDescription
varnameVariable nameNone
parameter required
Name of the variable to be filtered
viztype

"slider"
"verticalslider"
"combo"
"spinner",
"horizontallist"
"verticallist"
"textfield"

"combo", "slider" or "textfield"
depending on the variable’s settings
horizontallist and verticallist are only available for variables with explicit valuesVariable display type:
  • Horizontal slider
  • Vertical slider
  • Drop-down list
  • Spinner
  • Horizontal list
  • Vertical list
  • Text field
hidevarnameboolean"false" Hide the variable name

Related pages...