n = document.getElementById('select-quantity').value;	// Quantity of data to be shown
			
			// Populate the lists
			mainChart.data.datasets.forEach(dataset => {
				// Add all the labels to the dataset_list
				dataset_list.push(dataset.label);

				// Add all the types to the dataset_bar_list
				dataset_type_list.push(dataset.type);

				// Add only the labels of 'bar' datasets to the dataset_bar_list
				if (dataset.type == 'bar') {
					dataset_bar_list.push(dataset.label);
				} else {
					dataset_b