Euro indicators 30 August 2024 Next release: 2 October 2024
July 2024
Skip to the content
EU at 6.0%
Overview
In July 2024, the euro area seasonally-adjusted unemployment rate was 6.4%, down from 6.5% in June 2024 and from 6.6% in July 2023. The EU unemployment rate was 6.0% in July 2024, stable compared with June 2024 as well as with July 2023. These figures are published by Eurostat, the statistical office of the European Union.
Eurostat estimates that 13.108 million persons in the EU, of whom 10.990 million in the euro area, were unemployed in July 2024.
Compared with June 2024, unemployment decreased by 82 thousand in the EU and by 114 thousand in the euro area.
Compared with July 2023, unemployment decreased by 72 thousand in the EU and by 190 thousand in the euro area.
Youth unemployment
In July 2024, 2.818 million young persons (under 25) were unemployed in the EU, of whom 2.263 million were in the euro area. In July 2024, the youth unemployment rate was 14.5% in the EU, down from 14.6% in June 2024, and 14.2% in the euro area, down from 14.4% in the previous month.
Compared with June 2024, youth unemployment decreased by 25thousand in the EU and by 37 thousand in the euro area.
Compared with July 2023, youth unemployment increased by 8 thousand in the EU, while it decreased by 66 thousand in the euro area.
Unemployment by sex
In July 2024, the unemployment rate for women was 6.1% in the EU, down from 6.2% in June 2024, and the unemployment rate for men was 5.8%, stable compared with the previous month. In the euro area, the unemployment rate for women was 6.6%, down from 6.7% in previous month, and the unemployment rate for men was 6.2%, stable compared with June 2024.
Additional labour market indicators
The estimates in this News Release are based on the globally used International Labour Organisation (ILO) standard definition of unemployment, which counts as unemployed people without a job who have been actively seeking work in the last four weeks and are available to start work within the next two weeks.
To capture in full the labour market situation, the data on unemployment have been complemented by additional indicators, e.g. underemployed part-time workers, persons seeking work but not immediately available and persons available to work but not seeking, released together with LFS data for the first quarter of 2024.
LFS data for the second quarter of 2024 will be released on 13 September 2024.
Tables
Seasonally adjusted unemployment, totals | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Rates (%) | Number of persons (in thousands) | |||||||||
2023 | 2024 | 2023 | 2024 | |||||||
Jul | Apr | May | Jun | Jul | Jul | Apr | May | Jun | Jul | |
Euro area | 6.6 | 6.5 | 6.5 | 6.5 | 6.4 | 11 180 | 11 092 | 11 107 | 11 104 | 10 990 |
EU | 6.0 | 6.0 | 6.0 | 6.0 | 6.0 | 13 180 | 13 200 | 13 186 | 13 190 | 13 108 |
Belgium | 5.4 | 5.6 | 5.6 | 5.5 | 5.4 | 283 | 299 | 298 | 292 | 288 |
Bulgaria | 4.6 | 4.2 | 4.0 | 4.0 | 4.0 | 138 | 128 | 121 | 121 | 121 |
Czechia | 2.8 | 2.8 | 2.7 | 2.7 | 2.7 | 142 | 144 | 139 | 141 | 141 |
Denmark | 5.3 | 6.0 | 6.1 | 6.2 | 5.8 | 166 | 194 | 198 | 201 | 191 |
Germany | 3.0 | 3.4 | 3.4 | 3.4 | 3.4 | 1 322 | 1 507 | 1 524 | 1 531 | 1 531 |
Estonia | 7.6 | 7.5 | 7.4 | 7.3 | 7.5 | 56 | 57 | 57 | 56 | 57 |
Ireland | 4.3 | 4.3 | 4.4 | 4.5 | 4.7 | 120 | 123 | 126 | 129 | 136 |
Greece | 11.1 | 10.5 | 10.3 | 9.5 | 9.9 | 527 | 506 | 488 | 448 | 465 |
Spain | 12.0 | 11.6 | 11.6 | 11.5 | 11.5 | 2 908 | 2 842 | 2 840 | 2 830 | 2 817 |
France | 7.4 | 7.4 | 7.5 | 7.5 | 7.5 | 2 280 | 2 303 | 2 331 | 2 344 | 2 339 |
Croatia | 6.1 | 5.1 | 5.1 | 5.0 | 5.0 | 106 | 90 | 89 | 88 | 87 |
Italy | 7.8 | 6.8 | 6.8 | 6.9 | 6.5 | 1 993 | 1 743 | 1 745 | 1 767 | 1 660 |
Cyprus | 5.8 | 5.0 | 4.8 | 5.1 | 5.4 | 29 | 25 | 24 | 26 | 28 |
Latvia | 6.6 | 7.0 | 7.0 | 6.9 | 6.9 | 62 | 66 | 66 | 65 | 65 |
Lithuania | 6.6 | 7.5 | 7.4 | 7.2 | 8.0 | 102 | 116 | 115 | 115 | 124 |
Luxembourg | 5.2 | 5.7 | 5.8 | 5.8 | 5.8 | 18 | 20 | 20 | 20 | 20 |
Hungary | 4.0 | 4.3 | 4.3 | 4.3 | 4.3 | 198 | 214 | 212 | 211 | 213 |
Malta | 3.0 | 3.1 | 3.2 | 3.1 | 3.0 | 9 | 10 | 10 | 10 | 10 |
Netherlands | 3.6 | 3.7 | 3.6 | 3.6 | 3.6 | 362 | 375 | 367 | 370 | 370 |
Austria | 5.5 | 5.0 | 5.1 | 5.2 | 5.0 | 259 | 238 | 241 | 247 | 236 |
Poland | 2.8 | 2.9 | 2.9 | 2.9 | 2.9 | 492 | 507 | 506 | 509 | 509 |
Portugal | 6.2 | 6.4 | 6.4 | 6.4 | 6.2 | 334 | 348 | 347 | 344 | 332 |
Romania | 5.6 | 5.2 | 5.3 | 5.1 | 5.4 | 458 | 431 | 440 | 431 | 451 |
Slovenia | 3.8 | 3.5 | 3.5 | 3.5 | 3.3 | 39 | 36 | 36 | 35 | 34 |
Slovakia | 5.9 | 5.4 | 5.4 | 5.3 | 5.3 | 163 | 150 | 149 | 147 | 147 |
Finland | 7.3 | 8.1 | 8.2 | 8.3 | 8.4 | 207 | 232 | 235 | 238 | 240 |
Sweden | 7.7 | 8.3 | 8.3 | 8.3 | 8.3 | 438 | 476 | 477 | 478 | 478 |
Iceland | 2.5 | : | : | : | : | 6 | : | : | : | : |
Norway | 3.6 | 4.0 | 4.0 | 4.0 | 4.0 | 107 | 121 | 121 | 121 | 121 |
Switzerland | 4.1 | 4.2 | 4.3 | 4.2 | : | 205 | 212 | 217 | 215 | : |
United States | 3.5 | 3.9 | 4.0 | 4.1 | 4.3 | 5 846 | 6 436 | 6 614 | 6 807 | 7 104 |
: Data not available Source datasets: une_rt_m (rates) and une_rt_m (in 1 000 persons) |
Seasonally adjusted youth (under 25s) unemployment | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Rates (%) | Number of persons (in thousands) | |||||||||
2023 | 2024 | 2023 | 2024 | |||||||
Jul | Apr | May | Jun | Jul | Jul | Apr | May | Jun | Jul | |
Euro area | 14.6 | 14.5 | 14.6 | 14.4 | 14.2 | 2 329 | 2 320 | 2 327 | 2 300 | 2 263 |
EU | 14.5 | 14.7 | 14.7 | 14.6 | 14.5 | 2 810 | 2 869 | 2 865 | 2 843 | 2 818 |
Belgium | 17.5 | 16.7 | 16.7 | 16.7 | : | 75 | 69 | 69 | 69 | : |
Bulgaria | 13.5 | 13.1 | 12.0 | 11.5 | 11.5 | 16 | 16 | 14 | 13 | 13 |
Czechia | 9.9 | 8.0 | 9.6 | 10.5 | 11.6 | 29 | 23 | 27 | 31 | 35 |
Denmark | 11.5 | 12.3 | 13.7 | 14.7 | 13.6 | 52 | 59 | 67 | 76 | 66 |
Germany | 5.6 | 6.6 | 6.6 | 6.6 | 6.6 | 257 | 304 | 306 | 306 | 305 |
Estonia | 22.3 | 20.6 | 22.8 | 23.0 | 22.8 | 14 | 13 | 14 | 14 | 14 |
Ireland | 10.5 | 10.1 | 10.1 | 10.4 | 11.4 | 38 | 37 | 36 | 38 | 42 |
Greece | 27.0 | 24.2 | 24.9 | 23.8 | 20.0 | 71 | 68 | 65 | 60 | 49 |
Spain | 28.1 | 26.7 | 26.5 | 25.9 | 25.5 | 489 | 472 | 474 | 464 | 460 |
France | 17.6 | 17.6 | 17.6 | 17.6 | 17.2 | 595 | 595 | 597 | 595 | 584 |
Croatia | 18.6 | 16.7 | 16.7 | 16.7 | : | 23 | 21 | 21 | 21 | : |
Italy | 22.8 | 20.9 | 21.2 | 21.5 | 20.8 | 347 | 307 | 311 | 313 | 307 |
Cyprus | 16.9 | 15.4 | 15.4 | 15.4 | : | 6 | 5 | 5 | 5 | : |
Latvia | 10.7 | 15.2 | 17.1 | 17.3 | 16.2 | 7 | 10 | 11 | 11 | 10 |
Lithuania | 13.0 | 16.3 | 20.1 | 21.4 | 19.0 | 13 | 18 | 22 | 23 | 20 |
Luxembourg | 17.9 | 20.2 | 20.5 | 20.3 | 20.3 | 5 | 5 | 5 | 5 | 5 |
Hungary | 12.1 | 14.3 | 13.3 | 12.9 | 14.7 | 38 | 46 | 43 | 41 | 46 |
Malta | 8.4 | 7.5 | 8.0 | 8.4 | 8.7 | 2 | 2 | 2 | 2 | 2 |
Netherlands | 8.6 | 8.7 | 8.4 | 8.6 | 8.6 | 155 | 159 | 154 | 157 | 156 |
Austria | 10.9 | 9.7 | 9.9 | 9.6 | 9.7 | 59 | 49 | 50 | 50 | 50 |
Poland | 11.2 | 10.6 | 10.2 | 10.1 | 10.0 | 124 | 116 | 112 | 110 | 108 |
Portugal | 20.7 | 22.3 | 23.5 | 21.7 | 20.9 | 81 | 83 | 87 | 79 | 76 |
Romania | 21.3 | 23.2 | 23.2 | 23.2 | : | 102 | 114 | 114 | 114 | : |
Slovenia | 11.5 | 10.0 | 10.0 | 10.0 | : | 8 | 7 | 7 | 7 | : |
Slovakia | 20.5 | 21.1 | 21.3 | 21.0 | 21.0 | 29 | 30 | 30 | 30 | 30 |
Finland | 16.8 | 18.1 | 17.9 | 17.8 | 17.7 | 54 | 59 | 59 | 58 | 58 |
Sweden | 21.6 | 24.2 | 24.3 | 24.3 | 24.4 | 147 | 166 | 167 | 169 | 169 |
Iceland | 7.2 | : | : | : | : | 3 | : | : | : | : |
Norway | 11.1 | 13.9 | 12.7 | 12.1 | 11.9 | 48 | 61 | 56 | 54 | 52 |
Switzerland | 8.5 | 7.5 | 7.4 | 6.8 | : | 50 | 44 | 44 | 41 | : |
: Data not available Belgium, Croatia, Cyprus, Romania and Slovenia: quarterly data Source datasets: une_rt_m (rates) and une_rt_m (in 1 000 persons) |
Seasonally adjusted unemployment rates (%), by sex | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Males | Females | |||||||||
2023 | 2024 | 2023 | 2024 | |||||||
Jul | Apr | May | Jun | Jul | Jul | Apr | May | Jun | Jul | |
Euro area | 6.2 | 6.2 | 6.2 | 6.2 | 6.2 | 7.0 | 6.8 | 6.8 | 6.7 | 6.6 |
EU | 5.7 | 5.8 | 5.8 | 5.8 | 5.8 | 6.4 | 6.2 | 6.2 | 6.2 | 6.1 |
Belgium | 5.9 | 6.1 | 5.9 | 5.8 | 5.8 | 4.8 | 5.0 | 5.1 | 5.1 | 5.0 |
Bulgaria | 4.7 | 4.3 | 4.1 | 4.1 | 4.2 | 4.4 | 4.0 | 3.8 | 3.8 | 3.7 |
Czechia | 2.2 | 2.3 | 2.5 | 2.5 | 2.5 | 3.4 | 3.3 | 3.0 | 3.1 | 3.1 |
Denmark | 5.1 | 5.9 | 5.4 | 5.6 | 5.2 | 5.5 | 6.0 | 6.8 | 6.8 | 6.6 |
Germany | 3.2 | 3.7 | 3.7 | 3.7 | 3.7 | 2.7 | 3.1 | 3.1 | 3.1 | 3.1 |
Estonia | 7.2 | 7.0 | 7.3 | 7.4 | 7.7 | 7.9 | 8.0 | 7.5 | 7.3 | 7.3 |
Ireland | 4.5 | 4.3 | 4.4 | 4.5 | 4.7 | 4.1 | 4.4 | 4.4 | 4.5 | 4.8 |
Greece | 8.5 | 8.4 | 8.0 | 7.6 | 7.8 | 14.4 | 13.1 | 13.2 | 11.9 | 12.5 |
Spain | 10.5 | 10.3 | 10.3 | 10.2 | 10.2 | 13.7 | 13.1 | 13.1 | 13.0 | 12.9 |
France | 7.5 | 7.4 | 7.4 | 7.4 | 7.4 | 7.3 | 7.4 | 7.5 | 7.5 | 7.5 |
Croatia | 5.6 | 4.7 | 4.7 | 4.8 | 4.8 | 6.7 | 5.6 | 5.5 | 5.3 | 5.2 |
Italy | 6.8 | 6.1 | 6.2 | 6.3 | 6.2 | 9.2 | 7.8 | 7.7 | 7.7 | 6.8 |
Cyprus | 6.0 | 4.6 | 4.3 | 4.5 | 4.6 | 5.5 | 5.4 | 5.3 | 5.8 | 6.2 |
Latvia | 7.9 | 7.8 | 7.9 | 8.0 | 8.3 | 5.2 | 6.2 | 6.0 | 5.8 | 5.5 |
Lithuania | 7.1 | 8.1 | 8.4 | 8.3 | 8.4 | 6.0 | 6.9 | 6.4 | 6.0 | 7.6 |
Luxembourg | 4.9 | 5.7 | 5.9 | 5.9 | 5.9 | 5.5 | 5.7 | 5.7 | 5.7 | 5.8 |
Hungary | 4.0 | 4.4 | 4.3 | 4.2 | 4.3 | 4.0 | 4.2 | 4.2 | 4.3 | 4.3 |
Malta | 3.1 | 3.6 | 3.6 | 3.6 | 3.4 | 2.9 | 2.5 | 2.5 | 2.4 | 2.4 |
Netherlands | 3.5 | 3.6 | 3.5 | 3.5 | 3.5 | 3.7 | 3.8 | 3.7 | 3.8 | 3.8 |
Austria | 5.6 | 5.1 | 5.8 | 5.7 | 5.7 | 5.3 | 4.9 | 4.4 | 4.7 | 4.3 |
Poland | 2.7 | 2.9 | 2.9 | 2.9 | 2.9 | 2.8 | 2.9 | 2.8 | 2.8 | 2.8 |
Portugal | 5.8 | 5.8 | 5.9 | 6.1 | 5.9 | 6.7 | 7.0 | 6.9 | 6.7 | 6.5 |
Romania | 5.8 | 5.6 | 5.5 | 5.5 | 5.7 | 5.4 | 4.6 | 4.9 | 4.6 | 5.1 |
Slovenia | 3.7 | 3.3 | 3.5 | 3.5 | 3.3 | 3.9 | 3.6 | 3.6 | 3.5 | 3.4 |
Slovakia | 5.7 | 4.9 | 4.9 | 4.8 | 4.7 | 6.0 | 6.0 | 6.0 | 5.9 | 6.0 |
Finland | 8.0 | 9.2 | 9.4 | 9.6 | 9.7 | 6.6 | 7.0 | 7.1 | 7.0 | 7.0 |
Sweden | 7.5 | 8.4 | 8.4 | 8.4 | 8.4 | 7.9 | 8.3 | 8.3 | 8.3 | 8.3 |
Iceland | 2.0 | : | : | : | : | 3.1 | : | : | : | : |
Norway | 3.8 | 4.5 | 4.2 | 4.2 | 4.0 | 3.6 | 4.2 | 3.9 | 3.9 | 3.8 |
Switzerland | 3.8 | 3.9 | 4.0 | 4.0 | : | 4.4 | 4.4 | 4.5 | 4.5 | : |
: Data not available Source dataset: une_rt_m |
Notes for users
Revisions and timetable
The data in this News Release can be subject to revisions, caused by updates to the seasonally adjusted series whenever new monthly data are added; the inclusion of the most recent LFS data in the calculation process; update of seasonal adjustment models with complete annual data.
Compared with the rates published in News Release of 1 August 2024, the June 2024 unemployment rate for the EU and the unemployment rate for the euro area remained unchanged. Among EU Member States, the rate has been revised by more than 0.1 percentage points (pp) downwards for Lithuania (by 1.0 pp), Bulgaria (by 0.5 pp), Belgium and Romania (both by 0.4 pp), Croatia and Portugal (both by 0.3 pp) as well as for Slovakia (by 0.2 pp). The rate has been revised by more than 0.1 percentage points (pp) upwards for Cyprus (by 0.7 pp), Slovenia (by 0.4 pp), Denmark and Ireland (both by 0.3 pp) as well as for Latvia (by 0.2 pp).
Country notes
Germany, the Netherlands, Finland, Sweden as well as Iceland and Norway: the trend component is used instead of the more volatile seasonally adjusted data.
Estonia and Portugal: 3-month moving averages of LFS data are used instead of pure monthly indicators.
Methods and definitions
Eurostat publishes harmonised unemployment rates for individual EU Member States, the euro area and the EU. These unemployment rates are based on the definition recommended by the International Labour Organisation (ILO). The measurement is based on a harmonised data source, the European Union Labour Force Survey (LFS).
Based on the ILO definition, Eurostat defines unemployed persons as persons aged 15 to 74 who:
are without work;
are available to start work within the next two weeks;
and have actively sought employment at some time during the previous four weeks.
The unemployment rate is the number of people unemployed as a percentage of the labour force.
The labour force is the total number of people employed plus unemployed. In this news release unemployment rates are based on employment and unemployment data covering persons aged 15 to 74.
The youth unemployment rate is the number of people aged 15 to 24 unemployed as a percentage of the labour force of the same age. Therefore, the youth unemployment rate should not be interpreted as the share of jobless people in the overall youth population.
When data for the most recent month are not available for a Member State, EU and EA aggregates are calculated using the latest data available for that Member State.
Geographical information
Euro area (EA20): Belgium, Germany, Estonia, Ireland, Greece, Spain, France, Croatia, Italy, Cyprus, Latvia, Lithuania, Luxembourg, Malta, the Netherlands, Austria, Portugal, Slovenia, Slovakia and Finland.
European Union (EU27): 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
Website section on employment and unemployment
Database section on unemployment, including non-seasonally adjusted and trend data
Statistics Explained articles on unemployment
Metadata on adjusted unemployment series
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
Thibaut HENRION
Phone: (+352) 4301 31 686
Boyan GENEV
Phone: (+352) 4301 36 409
E-mail: estat-monthly-unemployment@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