Euro indicators 6 August 2024 Next release: 5 September 2024
June 2024 compared with May 2024
Skip to the content
Down by 0.3% in the euro area and up by 0.1% in the EU compared with June 2023
Overview
In June 2024, compared with May 2024, the seasonally adjusted retail trade volume decreased by 0.3% in the euro area and by 0.1% in the EU, according to first estimates from Eurostat, the statistical office of the European Union.
In May 2024, retail trade volume grew by 0.1% in both the euro area and the EU.
In June 2024 compared with June 2023, the calendar adjusted retail sales index decreased by 0.3% in the euro area and increased by 0.1% in the EU.
Monthly comparison by retail sector and by Member State
In the euro area in June 2024, compared with May 2024, the volume of retail trade
decreased for food, drinks, tobacco by 0.7%,
decreased for non-food products (except automotive fuel) by 0.1%,
increased for automotive fuel in specialised stores by 0.5%.
In the EU, the volume of retail trade
decreased for food, drinks, tobacco by 1.0%,
remained stable for non-food products (except automotive fuel),
increased for automotive fuel in specialised stores by 0.6%.
Among Member States for which data are available, the largest monthly decreases in the total retail trade volume were recorded in Croatia (-2.7%), Austria (-2.3%), Latvia and Lithuania (both -1.7%). The highest increases were observed in Romania (+1.8%), Bulgaria (+1.4%) and Denmark (+1.0%).
Annual comparison by retail sector and by Member State
In the euro area in June 2024, compared with June 2023, the volume of retail trade
decreased for food, drinks, tobacco by 0.7%,
increased for non-food products (except automotive fuel) by 0.3%,
increased for automotive fuel in specialised stores by 0.3%.
In the EU, the volume of retail trade
decreased for food, drinks, tobacco by 0.5%,
increased for non-food products (except automotive fuel) by 0.7%,
increased for automotive fuel in specialised stores by 0.5%.
Among Member States for which data are available, the highest annual increases in the total retail trade volume were recorded in Romania (+10.2%), Luxembourg (+7.9%) and Croatia (+5.4%). The largest decreases were observed in Belgium (-7.3%), Estonia (-4.1%) and Austria (-3.9%).
Tables
Volume of retail trade % change compared with the previous month* | ||||||
---|---|---|---|---|---|---|
Jan-24 | Feb-24 | Mar-24 | Apr-24 | May-24 | Jun-24 | |
Euro area | ||||||
Total retail trade | 0.0 | -0.2 | 0.7 | -0.1 | 0.1 | -0.3 |
Food, drinks, tobacco | 0.3 | -0.2 | 1.0 | -0.9 | 1.0 | -0.7 |
Non-food products (except automotive fuel) | 0.3 | 0.5 | -0.2 | 0.7 | -0.3 | -0.1 |
Automotive fuel in specialised stores | 0.5 | -1.1 | 0.9 | -0.7 | 0.3 | 0.5 |
EU | ||||||
Total retail trade | 0.2 | 0.0 | 0.5 | -0.2 | 0.1 | -0.1 |
Food, drinks, tobacco | 0.4 | -0.2 | 0.9 | -1.3 | 1.4 | -1.0 |
Non-food products (except automotive fuel) | 0.5 | 0.4 | -0.2 | 0.8 | -0.4 | 0.0 |
Automotive fuel in specialised stores | 0.3 | 0.0 | 0.4 | -0.7 | -0.2 | 0.6 |
* Calendar and seasonally adjusted Source dataset: sts_trtu_m |
Volume of retail trade % change compared with the previous month* | ||||||
---|---|---|---|---|---|---|
Jan-24 | Feb-24 | Mar-24 | Apr-24 | May-24 | Jun-24 | |
Euro area | 0.0 | -0.2 | 0.7 | -0.1 | 0.1 | -0.3 |
EU | 0.2 | 0.0 | 0.5 | -0.2 | 0.1 | -0.1 |
Belgium | -0.7 | -1.9 | 0.4 | -0.5 | 0.4 | -1.2 |
Bulgaria | 0.8 | 0.4 | 0.1 | 1.3 | -0.4 | 1.4 |
Czechia | 1.4 | -0.3 | 1.3 | 0.0 | 0.0 | c |
Denmark | -1.8 | 1.4 | 0.0 | -2.9 | 2.2 | 1.0 |
Germany** | -0.3 | -1.5 | 2.7 | -0.2 | : | : |
Estonia | -1.7 | 0.6 | 0.1 | -0.9 | -0.7 | -0.9 |
Ireland | 0.2 | 0.0 | -0.1 | 0.1 | -0.2 | -0.7 |
Greece | -6.1 | 0.7 | 6.5 | -5.4 | 10.6 | c |
Spain | -0.5 | 0.6 | -0.5 | 0.8 | -0.5 | 0.3 |
France | 0.8 | 0.5 | -0.4 | 0.0 | -0.1 | -0.2 |
Croatia | 0.5 | 0.8 | 0.5 | 0.7 | 0.6 | -2.7 |
Italy | 0.2 | 0.0 | 0.1 | -0.2 | 0.0 | -0.1 |
Cyprus | 1.8 | -1.9 | 2.2 | -1.1 | 1.7 | 0.1 |
Latvia | -1.3 | 0.4 | 0.8 | -2.7 | 0.1 | -1.7 |
Lithuania | 0.8 | 0.8 | 1.6 | -1.3 | 2.1 | -1.7 |
Luxembourg | 1.0 | 2.9 | 1.4 | 1.1 | -1.7 | 0.6 |
Hungary | 0.1 | -0.3 | 1.9 | -1.0 | 0.1 | -0.2 |
Malta | 0.0 | 0.8 | -1.1 | 1.2 | -0.4 | -0.6 |
Netherlands | 1.2 | 0.7 | -0.5 | -1.6 | 0.6 | -1.4 |
Austria | 1.0 | 0.3 | -0.8 | 1.7 | -0.3 | -2.3 |
Poland | 1.8 | 0.7 | -1.0 | -0.9 | -0.4 | -0.2 |
Portugal | -0.2 | 0.4 | -0.1 | 2.1 | 0.5 | 0.7 |
Romania | 4.6 | -0.3 | 1.0 | 0.6 | -0.3 | 1.8 |
Slovenia | -1.6 | -0.3 | 1.6 | 0.6 | -0.9 | -1.0 |
Slovakia | -1.3 | 0.9 | -0.7 | 2.3 | -1.1 | -1.1 |
Finland | 0.2 | 0.2 | 0.9 | -1.4 | 2.3 | -1.2 |
Sweden | 0.1 | 2.8 | -2.3 | 0.2 | 0.5 | -1.0 |
Norway | 0.0 | 0.1 | 0.3 | -0.5 | 4.7 | -5.1 |
Switzerland | 0.7 | 0.0 | -0.3 | 0.1 | -0.2 | -0.1 |
* Calendar and seasonally adjusted ** The publication of German data is delayed due to the changeover to new data requirements. : Data not available c Confidential Source dataset: sts_trtu_m |
Volume of retail trade % change compared with the same month of the previous year* | ||||||
---|---|---|---|---|---|---|
Jan-24 | Feb-24 | Mar-24 | Apr-24 | May-24 | Jun-24 | |
Euro area | ||||||
Total retail trade | -0.7 | -0.3 | 0.6 | 0.7 | 0.5 | -0.3 |
Food, drinks, tobacco | -1.3 | -1.2 | 1.0 | -0.3 | 0.5 | -0.7 |
Non-food products (except automotive fuel) | -0.7 | 0.7 | 0.8 | 1.3 | 0.7 | 0.3 |
Automotive fuel in specialised stores | 0.6 | -1.4 | -1.0 | 1.1 | 0.2 | 0.3 |
EU | ||||||
Total retail trade | -0.5 | 0.2 | 1.3 | 0.4 | 0.7 | 0.1 |
Food, drinks, tobacco | -0.8 | -0.5 | 1.3 | -0.1 | 0.9 | -0.5 |
Non-food products (except automotive fuel) | -0.5 | 1.1 | 1.8 | 0.8 | 0.9 | 0.7 |
Automotive fuel in specialised stores | -0.5 | -1.0 | -1.0 | 0.9 | -0.3 | 0.5 |
* Calendar adjusted Source dataset: sts_trtu_m |
Volume of retail trade % change compared with the same month of the previous year* | ||||||
---|---|---|---|---|---|---|
Jan-24 | Feb-24 | Mar-24 | Apr-24 | May-24 | Jun-24 | |
Euro area | -0.7 | -0.3 | 0.6 | 0.7 | 0.5 | -0.3 |
EU | -0.5 | 0.2 | 1.3 | 0.4 | 0.7 | 0.1 |
Belgium | -3.8 | -6.8 | -4.6 | -5.8 | -5.2 | -7.3 |
Bulgaria | -0.1 | 3.1 | 0.4 | 9.8 | 1.6 | 4.4 |
Czechia | 3.3 | 2.5 | 5.8 | 5.7 | 4.5 | c |
Denmark | 0.7 | 2.1 | 2.7 | -1.8 | -0.6 | 1.7 |
Germany** | -1.2 | -2.3 | 1.0 | 0.3 | : | : |
Estonia | -6.7 | -3.5 | -2.3 | -4.9 | -4.0 | -4.1 |
Ireland | 1.2 | 1.1 | 1.5 | 0.9 | -0.7 | -0.3 |
Greece | -9.3 | -9.5 | 5.3 | -6.2 | 10.5 | c |
Spain | 0.3 | 1.8 | 0.6 | 0.5 | 0.1 | 0.3 |
France | 0.5 | 1.6 | 0.6 | 2.8 | 1.8 | 0.4 |
Croatia | 7.9 | 9.1 | 8.9 | 8.6 | 8.4 | 5.4 |
Italy | -2.6 | -0.6 | -1.3 | -1.0 | -0.8 | -0.9 |
Cyprus | 6.1 | 0.6 | 5.0 | 1.9 | 3.8 | 3.9 |
Latvia | -1.3 | -0.5 | 2.9 | 0.1 | 0.6 | -2.0 |
Lithuania | -0.7 | 2.6 | 6.2 | 2.4 | 5.7 | 3.1 |
Luxembourg | 10.2 | 16.6 | 17.7 | 20.3 | 10.6 | 7.9 |
Hungary | 0.6 | 1.7 | 4.1 | 3.2 | 3.7 | 2.6 |
Malta | 1.5 | 4.6 | -0.9 | 4.0 | 1.4 | -1.0 |
Netherlands | 0.9 | 2.5 | 3.2 | 1.3 | 1.9 | -2.3 |
Austria | -2.1 | -1.0 | -1.8 | 1.8 | 1.0 | -3.9 |
Poland | -1.6 | 2.2 | 8.2 | -7.3 | -0.8 | -0.8 |
Portugal | 0.2 | 1.2 | 0.9 | 1.9 | 2.9 | 3.3 |
Romania | 7.5 | 7.4 | 5.7 | 9.9 | 6.1 | 10.2 |
Slovenia | -2.0 | -4.4 | -1.7 | 1.2 | -0.6 | -0.1 |
Slovakia | 1.7 | 4.1 | 1.3 | 8.6 | 5.3 | 1.6 |
Finland | -2.8 | -2.4 | 0.6 | -3.6 | 1.1 | 0.1 |
Sweden | -3.1 | 2.4 | 0.0 | -0.1 | 1.2 | -0.3 |
Norway | -1.1 | -0.3 | 0.7 | 0.9 | 3.5 | -3.0 |
Switzerland | 0.1 | -0.3 | -0.2 | 2.4 | -0.2 | -2.2 |
* Calendar adjusted ** The publication of German data is delayed due to the changeover to new data requirements. : Data not available c Confidential Source dataset: sts_trtu_m |
Volume of retail trade, calendar and seasonally adjusted indices (base year 2021) | ||||||
---|---|---|---|---|---|---|
Jan-24 | Feb-24 | Mar-24 | Apr-24 | May-24 | Jun-24 | |
Euro area | 99.0 | 98.8 | 99.5 | 99.4 | 99.5 | 99.2 |
EU | 99.5 | 99.5 | 100.0 | 99.8 | 99.9 | 99.8 |
Belgium | 86.3 | 84.7 | 85.0 | 84.6 | 84.9 | 83.9 |
Bulgaria | 107.4 | 107.8 | 107.9 | 109.3 | 108.9 | 110.4 |
Czechia | 94.6 | 94.3 | 95.5 | 95.5 | 95.5 | c |
Denmark | 92.7 | 94.0 | 94.0 | 91.3 | 93.3 | 94.2 |
Germany* | 95.7 | 94.3 | 96.8 | 96.6 | : | : |
Estonia | 90.7 | 91.2 | 91.3 | 90.5 | 89.9 | 89.1 |
Ireland | 101.9 | 101.9 | 101.8 | 101.9 | 101.7 | 101.0 |
Greece | 94.9 | 95.6 | 101.8 | 96.3 | 106.5 | c |
Spain | 104.7 | 105.3 | 104.8 | 105.6 | 105.1 | 105.4 |
France | 102.3 | 102.8 | 102.4 | 102.4 | 102.3 | 102.1 |
Croatia | 109.9 | 110.8 | 111.3 | 112.1 | 112.8 | 109.7 |
Italy | 97.5 | 97.5 | 97.6 | 97.4 | 97.4 | 97.3 |
Cyprus | 113.7 | 111.5 | 114.0 | 112.8 | 114.7 | 114.8 |
Latvia | 102.6 | 103.0 | 103.8 | 101.0 | 101.1 | 99.4 |
Lithuania | 100.7 | 101.5 | 103.1 | 101.8 | 103.9 | 102.1 |
Luxembourg | 112.6 | 115.9 | 117.5 | 118.8 | 116.8 | 117.5 |
Hungary | 98.7 | 98.4 | 100.3 | 99.3 | 99.4 | 99.2 |
Malta | 112.6 | 113.5 | 112.2 | 113.6 | 113.1 | 112.4 |
Netherlands | 101.1 | 101.8 | 101.3 | 99.7 | 100.3 | 98.9 |
Austria | 95.0 | 95.3 | 94.5 | 96.1 | 95.8 | 93.6 |
Poland | 108.3 | 109.1 | 108.0 | 107.0 | 106.6 | 106.4 |
Portugal | 106.7 | 107.1 | 107.0 | 109.2 | 109.7 | 110.5 |
Romania | 113.4 | 113.1 | 114.2 | 114.9 | 114.6 | 116.7 |
Slovenia | 97.8 | 97.5 | 99.1 | 99.7 | 98.8 | 97.8 |
Slovakia | 100.8 | 101.7 | 101.0 | 103.3 | 102.2 | 101.1 |
Finland | 91.9 | 92.1 | 92.9 | 91.6 | 93.7 | 92.6 |
Sweden | 92.8 | 95.4 | 93.2 | 93.4 | 93.9 | 93.0 |
Norway | 92.0 | 92.1 | 92.4 | 91.9 | 96.2 | 91.3 |
Switzerland | 98.9 | 98.9 | 98.6 | 98.7 | 98.5 | 98.4 |
* The publication of German data is delayed due to the changeover to new data requirements. : Data not available c Confidential Source dataset: sts_trtu_m |
Volume of retail trade, calendar adjusted indices (base year 2021) | ||||||
---|---|---|---|---|---|---|
Jan-24 | Feb-24 | Mar-24 | Apr-24 | May-24 | Jun-24 | |
Euro area | 93.0 | 87.8 | 97.9 | 96.1 | 99.4 | 99.6 |
EU | 92.7 | 88.1 | 98.6 | 96.9 | 100.2 | 100.3 |
Belgium | 84.0 | 74.8 | 84.5 | 83.2 | 86.8 | 86.9 |
Bulgaria | 98.5 | 96.5 | 104.3 | 108.3 | 106.4 | 109.9 |
Czechia | 85.1 | 81.3 | 92.9 | 91.3 | 96.1 | c |
Denmark | 85.4 | 81.9 | 92.2 | 90.7 | 98.2 | 97.0 |
Germany* | 88.1 | 85.1 | 98.5 | 96.2 | : | : |
Estonia | 81.2 | 77.6 | 90.8 | 87.3 | 93.5 | 91.5 |
Ireland | 94.3 | 95.1 | 93.1 | 98.0 | 96.3 | 98.1 |
Greece | 85.8 | 89.1 | 95.7 | 93.1 | 103.9 | c |
Spain | 104.1 | 92.0 | 101.3 | 101.2 | 104.2 | 107.2 |
France | 97.7 | 90.9 | 99.8 | 99.3 | 100.4 | 102.2 |
Croatia | 89.2 | 88.7 | 102.6 | 106.8 | 113.4 | 118.5 |
Italy | 91.5 | 87.1 | 94.1 | 88.2 | 97.4 | 97.4 |
Cyprus | 102.5 | 97.0 | 109.4 | 109.1 | 111.9 | 115.9 |
Latvia | 91.5 | 87.9 | 100.9 | 98.0 | 104.4 | 101.5 |
Lithuania | 90.0 | 87.3 | 101.1 | 99.9 | 108.3 | 104.4 |
Luxembourg | 108.3 | 107.9 | 122.4 | 117.8 | 113.3 | 114.4 |
Hungary | 85.6 | 85.2 | 98.3 | 95.5 | 99.3 | 100.8 |
Malta | 101.8 | 100.3 | 107.7 | 110.6 | 117.3 | 112.7 |
Netherlands | 95.8 | 89.2 | 100.5 | 98.4 | 104.6 | 101.2 |
Austria | 86.8 | 85.7 | 96.8 | 97.5 | 94.8 | 93.7 |
Poland | 97.4 | 96.8 | 111.7 | 107.7 | 107.6 | 106.6 |
Portugal | 98.0 | 92.6 | 102.7 | 102.3 | 107.9 | 106.0 |
Romania | 100.4 | 97.6 | 110.6 | 113.6 | 114.0 | 115.3 |
Slovenia | 89.5 | 85.2 | 100.7 | 99.3 | 98.0 | 100.0 |
Slovakia | 91.6 | 92.9 | 102.9 | 101.0 | 103.9 | 103.1 |
Finland | 80.2 | 76.8 | 88.6 | 88.3 | 98.7 | 99.6 |
Sweden | 81.5 | 80.6 | 91.1 | 92.6 | 100.6 | 99.4 |
Norway | 82.7 | 77.7 | 88.2 | 87.4 | 102.9 | 97.3 |
Switzerland | 92.6 | 87.7 | 99.6 | 95.7 | 100.9 | 97.8 |
* The publication of German data is delayed due to the changeover to new data requirements. : Data not available c Confidential Source dataset: sts_trtu_m |
Notes for users
Revisions and timetable
Data of previous months have been revised compared to those issued in the News Release of 5 July 2024. The monthly percentage increase for May 2024 remained unchanged at +0.1% in the euro area as well as in theEU. The annual percentage change has been revised from +0.3% to +0.5% in the euro area and from +0.6% to +0.7% in the EU.
Methods and definitions
The index of the volume of retail trade measures the evolution of the turnover in retail trade, adjusted for price changes (deflated), i.e. the evolution of the total amount of goods sold, based on data adjusted for calendar and seasonal effects.
Seasonally adjusted euro area and EU series are calculated by aggregating the seasonally adjusted national data.
Missing observations from Member States for recent months are estimated for the calculation of the euro area and the EU aggregates.
Starting with reference period January 2024, the base year of the data has been changed to 2021, since 2018 the base year had been 2015. More information on the reasons for and impact of the base year change can be found in the related Statistics Explained article.
Geographical information
The euro area (EA20) includes Belgium, Germany, Estonia, Ireland, Greece, Spain, France, Croatia, Italy, Cyprus, Latvia, Lithuania, Luxembourg, Malta, the Netherlands, Austria, Portugal, Slovenia, Slovakia and Finland.
The European Union (EU27) includes Belgium, Bulgaria, Czechia, Denmark, Germany, Estonia, Ireland, Greece, Spain, France, Croatia, Italy, Cyprus, Latvia, Lithuania, Luxembourg, Hungary, Malta, the Netherlands, Austria, Poland, Portugal, Romania, Slovenia, Slovakia, Finland and Sweden.
For more information
Database section on short-term business statistics
Statistics Explained article on the index of retail trade
The weights of the Member States in the EU and euro area aggregates
(See file Base year 2021 weights - Euro indicators releases)Euro indicators dashboard
Release calendar for Euro indicators
European Statistics Code of Practice
Get in touch
Media requests
Eurostat Media Support
Phone: (+352) 4301 33 408
E-mail: eurostat-mediasupport@ec.europa.eu
Further information on data
E-mail: ESTAT-STS-DATA@ec.europa.eu
Share component will be rendered here.
'; /** Retrieve the order from the tooltip option */ var sortOrder = option.tooltip.order; /** Sort the 'params' array based on the 'sortOrder' parameter. */ switch (sortOrder) { /** Sort by series name in ascending order. */ case 'seriesAsc': params = params.sort((a, b) => a.seriesName.localeCompare(b.seriesName)); break; /** Sort by series name in descending order. */ case 'seriesDesc': params = params.sort((a, b) => b.seriesName.localeCompare(a.seriesName)); break; /** Sort by numerical value in ascending order. */ case 'valueAsc': params = params.sort((a, b) => parseFloat(a.value) - parseFloat(b.value)); break; /** Sort by numerical value in descending order. */ case 'valueDesc': params = params.sort((a, b) => parseFloat(b.value) - parseFloat(a.value)); break; /** Reverse the current order. */ case 'reverse': params.reverse(); break; default: break; } /** Iterate over each series in the tooltip parameters */ for (var i = 0; i < params.length; i++) { /** Retrieve the name and value of the current series */ var seriesName = params[i].seriesName; var value = params[i].value; /** Replace every specific apostrphe by simple one. */ seriesName = seriesName.replaceAll("’", "'"); /** Convert the numeric value to its string representation. */ var strValue = String(value); /** Retrieve the axis used as value */ var axis = option.yAxis.type === 'value' ? option.yAxis : option.xAxis; /** Initialize the number of decimal places */ var decimals = option.tooltip.decimals; /** Check if decimals configuration is set to default and the value contains decimal places */ if (!decimals && strValue.indexOf('.') > -1) { /** Calculate the number of decimal places */ decimals = strValue.substring(strValue.indexOf('.'), strValue.length - 1).length; } else { /** If there are no decimal places, format the value with 1 decimal place */ decimals = decimals ? decimals : 1; /** Convert the value to a fixed-point notation string with a specified number of decimal places. */ value = Number(value).toFixed(decimals); } /** Convert -0 value to 0 with the specified or calculated number of decimal places.*/ if (Number(value) == -0) { value = (Number(value) + 0).toFixed(decimals); } /** Extract the unit from within the axis label */ var unit = axis.axisLabel.unit ? axis.axisLabel.unit : ''; /** Format the value using the appropriate number of decimal places */ value = isNaN(value) ? 'N/A' : Number(value).toLocaleString(option.lang ? option.lang : 'en', { minimumFractionDigits: decimals }) + unit; /** Retrieve the color of the current series */ const color = params[i].color; /** * Add the series name and value to the tooltip content * Use a circle icon with the series color */ tooltipContent += '
' + '' + '' + '' + seriesName + '' + '' + '' + value + '' + '
'; } /** Close the tooltip content container */ tooltipContent += '
'; /** Return the formatted tooltip content */ return tooltipContent; }}/* * This content is licensed according to the W3C Software License at * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document * * File: sortable-table.js * * Desc: Adds sorting to a HTML data table that implements ARIA Authoring Practices */'use strict';class SortableTable { constructor(tableNode) { this.tableNode = tableNode; this.columnHeaders = tableNode.querySelectorAll('thead th.sortable'); this.sortColumns = []; for (var i = 0; i < this.columnHeaders.length; i++) { var ch = this.columnHeaders[i]; var buttonNode = ch.querySelector('button'); if (buttonNode) { this.sortColumns.push(i); // buttonNode.setAttribute('data-column-index', i); // buttonNode.addEventListener('click', this.handleClick.bind(this)); ch.setAttribute('data-column-index', i); ch.addEventListener('click', this.handleClick.bind(this)); } } this.optionCheckbox = document.querySelector( 'input[type="checkbox"][value="show-unsorted-icon"]' ); if (this.optionCheckbox) { this.optionCheckbox.addEventListener( 'change', this.handleOptionChange.bind(this) ); if (this.optionCheckbox.checked) { this.tableNode.classList.add('show-unsorted-icon'); } } } setColumnHeaderSort(columnIndex) { if (typeof columnIndex === 'string') { columnIndex = parseInt(columnIndex); } for (var i = 0; i < this.columnHeaders.length; i++) { var ch = this.columnHeaders[i]; var buttonNode = ch.querySelector('button'); if (i === columnIndex) { var value = ch.getAttribute('aria-sort'); if (value === 'ascending') { ch.setAttribute('aria-sort', 'descending'); this.sortColumn( columnIndex, 'descending', ch.classList.contains('num')); } else if (value === 'descending') { ch.removeAttribute('aria-sort'); this.sortColumn( columnIndex, 'initial', true ); } else { ch.setAttribute('aria-sort', 'ascending'); this.sortColumn( columnIndex, 'ascending', ch.classList.contains('num') ); } } else { if (ch.hasAttribute('aria-sort') && buttonNode) { ch.removeAttribute('aria-sort'); } } } } sortColumn(columnIndex, sortValue, isNumber) { function compareValues(a, b) { if (a.value === b.value) return 0; if (sortValue === 'descending') { return isNumber ? b.value - a.value : (a.value > b.value ? -1 : 1); } else { return isNumber ? a.value - b.value : (a.value < b.value ? -1 : 1); } } if (typeof isNumber !== 'boolean') { isNumber = false; } var tbodyNode = this.tableNode.querySelector('tbody'); var rowNodes = []; var dataCells = []; var rowNode = tbodyNode.firstElementChild; var index = 0; while (rowNode) { rowNodes.push(rowNode); var rowCells = rowNode.querySelectorAll('th, td'); var dataCell = rowCells[columnIndex]; var data = {}; data.index = index; if (sortValue !== 'initial') { data.value = dataCell.textContent.toLowerCase().trim(); } else { data.value = rowNode.getAttribute('initial-position').toLowerCase().trim(); } if (isNumber) { data.value = parseFloat(data.value); } dataCells.push(data); rowNode = rowNode.nextElementSibling; index += 1; } dataCells.sort(compareValues); // remove rows while (tbodyNode.firstChild) { tbodyNode.removeChild(tbodyNode.lastChild); } // add sorted rows for (var i = 0; i < dataCells.length; i += 1) { let pos = [dataCells[i].index]; if (sortValue === "initial") { rowNodes[pos].classList.remove("sorted"); } else { rowNodes[pos].classList.add("sorted"); } tbodyNode.appendChild(rowNodes[pos]); } } /* EVENT HANDLERS */ handleClick(event) { var tgt = event.currentTarget; this.setColumnHeaderSort(tgt.getAttribute('data-column-index')); } handleOptionChange(event) { var tgt = event.currentTarget; if (tgt.checked) { this.tableNode.classList.add('show-unsorted-icon'); } else { this.tableNode.classList.remove('show-unsorted-icon'); } }}$(document).ready(function() { load(); });;}());
Subscribe to receive the latest Eurostat Euro indicators releases