h.min(quantity_data_shown, data_list.length); ++i){
				data_labels.push(data_list[i][data_columns.indexOf("name")]);
			}

			// Remove all datasets to update them with the new order
			mainChart.data.datasets.splice(0, dataset_list.length);

			// Change the data_labels of the chart
			mainChart.data.labels = data_labels;

			// Add the datasets with the previous type and data with the new order
			for (let i = 0; i < dataset_list.length; i++){
				data = []
				type = dataset_type_list[i]
				selected_co