This page documents how to embed charts and map. Principle is to use an iframe. The URL will build the charts and map with Vega (https://vega.github.io/).
Build embed URL
Base URL: https://webgate.acceptance.ec.europa.eu/eurostat/databrowser-embed/VegaEmbed
To build the URL, use the base URL and add the general mandatory parameters and the mandatory parameters corresponding to the selected visualisation.
General parameters
Mandatory parameters
There is two mandatory parameters.
The code which define the dataset to use. This code can be the one of a custom dataset.
When code contains "$DEFAULTVIEW" then data may change over time.
The visualisation which define the charts or map to embed possible values are:
- LINE for line chart
- VERTICAL_BAR for vertical bar chart
- HORIZONTAL_BAR for horizontal bar chart
- VERTICAL_BAR_OVERVIEW for vertical bar chart with bar overview
- HORIZONTAL_BAR_OVERVIEW for horizontal bar chart with bar overview
- MAP for country map
- MAP_NUTS for map with nuts
Optional parameters
The parameter language can be use to set the language to use (default: English). Possible values are: en for English, fr for French, and de for German.
Parameters for bar chart
Mandatory parameters
Bar chart is defined with the X-axis (parameter: x) where you set the code of the dimension to use. You can also define the list of position to display. For example:
x=geo to have all geographical entity positions
- x=geo:EU27_2020,EA19 to have only European Union - 27 countries (from 2020) and Euro area - 19 countries (from 2015)
The second parameter to define a bar chart is the series. This parameter contains the code of the dimension and the code of the position to use. For example:
series=time:2020 to have bar for year 2020
Optional parameters
For other dimensions, the default position is used. filter parameter is used to change this value. For example:
filter=unit:PAS,tra_meas:PAS_BRD_ARR,schedule:TOT,tra_cov:TOTAL
Other options
In order to customize the visualisation following parameter are available:
- Metadata options:
- title: text to use as title (default: dataset title)
- displaySubtitle: display dimensions and positions summary (default false)
- displayContext: display source of data and last update (default: true)
- Format options:
- dataLabelDisplay: none, all, all_flag, highlighted (default: none) similar to format option: show data labels
- sorting: protocol, descending, ascending (default: protocol) similar to format option: sorting
- Color palette similar to format option: color palette
- colorPalette: none, monocolour, contrasted (default: none)
- classAmount: from 2 to 12, ignored when combined with custom classification (default: 6)
- classification: quantile, equal, custom (default: quantile)
- when classification is custom define the parameter as: custom:limit1;limit2;limit3
- useGradient: will ignore: colorPalette, classAmount and classification (default: false)
- Other options:
- nestingGeoGroup: ignored when combined with protocol sorting (default: false)
- highlight: format is positionCode,positionCode2
- yAxisTicks: force ticks value on y axes (vertical bar)
- xAxisTicks: force ticks value on x axes (horizontal bar)
- Layout options:
- labelAngle: number corresponding to the angle of the text on x axis
- textLimit: size of the label on label axis
- hoverFill: color to use when hover a bar
Example
Parameters for line chart
Mandatory parameters
Line chart is defined with the series where you set the code of the dimension to use. You can also define the list of position to display. For example:
series=geo to have all geographical entity positions
- series=geo:EU27_2020,EA19 to have only European Union - 27 countries (from 2020) and Euro area - 19 countries (from 2015)
Optional parameters
To limit time position you can define the x parameter with the list of time to use. For example:
- x=2000,2001,2002,2003,2004,2005,2006,2007,2008
For other dimensions, the default position is used. filter parameter is used to change this value. For example:
filter=unit:PAS,tra_meas:PAS_BRD_ARR,schedule:TOT,tra_cov:TOTAL
Other options
In order to customize the visualisation following parameter are available:
- Metadata options:
- title: text to use as title (default: dataset title)
- displaySubtitle: display dimensions and positions summary (default false)
- displayContext: display source of data and last update (default: true)
- Format options:
- dataLabelDisplay: none, all_flag (default: none) similar to format option: show data labels
- startFromZero: (default: false) similar to format option: vertical axis (scale)
- displaySeriesMarker: (default: false) similar to format option: series markers
- breaksInTime: (default: false) similar to format option: breaks in Time selection
- Other options:
- highlight: format is positionCode,positionCode2
- displayLegend: display color associate to highlighted dimension(default: false)
- yAxisTicks: force ticks value on y axes
- Layout options:
- useMultiLineTooltip: to have tooltip of all other position at the same time (default: false)
Example
Parameters for map
Map is defined with the x where you set the code of the geo dimension to use. You can also define the list of position to display. For example:
x=geo to have all geographical entity positions
x=geo:BE,BG,CZ,DK,DE,EE,IE,EL,ES,FR,HR,IT,CY,LV,LT,LU,HU,MT,NL,AT,PL,PT,RO,SI,SK,FI,SE to have only EU countries
The second parameter filter to define a map is the list of position to use for other dimensions. For example:
filter=freq:A,indic_de:AVG,time:2020
Other options
- Format options:
- displayFlag (default: false) similar to format option: show data labels
- Color palette similar to format option: color palette
- colorPalette: monocolour, contrasted (default: monocolour)
- classAmount: from 2 to 12, ignored when combined with custom classification (default: 6)
- classification: quantile, equal, custom (default: quantile)
- when classification is custom define the parameter as: custom:limit1;limit2;limit3
- useGradient: will ignore: colorPalette, classAmount and classification (default: false)
- Layout options
- outerRegion: to display the outermost regions (default: false)
- displayLegend: to display legend associated to the map (default: false)
- displayGraticule: to display graticules (default: false)
Embed from Databrowser
Embed line chart with the embed feature (
) above the line chart.Embed bar chart with the embed feature (
) above the bar chart.Embed map with the embed feature (
) above the map.Options are automatically filled based on format and selection.
A preview is available.
Copy button will copy the iframe code to integrate.