ar_list.push('---');
				}
			});

			// Sort the data based on the selected order and direction
			if (direction.checked) {
				data_list.sort(function(x,y){return x[data_columns.indexOf(order)] - y[data_columns.indexOf(order)];});
				direction_label.innerHTML = "Ascending";
			} else {
				data_list.sort(function(x,y){return x[data_columns.indexOf(order)] - y[data_columns.indexOf(order)];}).reverse();
				direction_label.innerHTML = "Descending";
			}

			// Get the data labels
			for (let i = 0; i < Mat