diff --git a/res/stages/main-stage.fxml b/res/stages/main-stage.fxml
index c2f1a365d2da7440bf55d75c78c8c07b4d89f91c..1e6fdc9b6536a7d946ca517c86d9cf002de7367b 100644
--- a/res/stages/main-stage.fxml
+++ b/res/stages/main-stage.fxml
@@ -44,11 +44,11 @@
                                              </Label>
                                              <VBox layoutY="345.0" prefHeight="78.0" prefWidth="678.0">
                                                 <children>
-                                                   <HBox fx:id="legend" alignment="CENTER" prefHeight="100.0" prefWidth="200.0" spacing="10.0">
+                                                   <VBox fx:id="legend" alignment="CENTER" prefHeight="100.0" prefWidth="200.0" spacing="10.0">
                                                       <padding>
                                                          <Insets left="2.0" right="2.0" />
                                                       </padding>
-                                                   </HBox>
+                                                   </VBox>
                                                 </children></VBox>
                                           </children>
                                           <HBox.margin>
diff --git a/src/main/java/fr/univlille/sae/classification/controller/DataVisualizationController.java b/src/main/java/fr/univlille/sae/classification/controller/DataVisualizationController.java
index b0e8c0630c318b8edd5160cd52e72280cbdd791f..5ef74cc7e39ae4b8cb3dd04ad4ae9900740f78e6 100644
--- a/src/main/java/fr/univlille/sae/classification/controller/DataVisualizationController.java
+++ b/src/main/java/fr/univlille/sae/classification/controller/DataVisualizationController.java
@@ -8,6 +8,7 @@ import javafx.scene.chart.NumberAxis;
 import javafx.scene.chart.ScatterChart;
 import javafx.scene.control.Label;
 import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
 import javafx.stage.Stage;
 
 public abstract class DataVisualizationController {
@@ -20,7 +21,7 @@ public abstract class DataVisualizationController {
     Label AxesSelected;
 
     @FXML
-    HBox legend;
+    VBox legend;
 
 
     @FXML
@@ -147,9 +148,9 @@ public abstract class DataVisualizationController {
 
 
 
-    public void loadLegend(HBox hbox) {
+    public void loadLegend(VBox vBox) {
         this.legend.getChildren().clear();
-        this.legend.getChildren().addAll(hbox.getChildren());
+        this.legend.getChildren().addAll(vBox.getChildren());
     }
 
 
diff --git a/src/main/java/fr/univlille/sae/classification/model/LoadableData.java b/src/main/java/fr/univlille/sae/classification/model/LoadableData.java
index 670de56e73a5d89c5793525fd64709cc165ad66d..d1b6696c9a3b53870870913fb953e819b3f1a413 100644
--- a/src/main/java/fr/univlille/sae/classification/model/LoadableData.java
+++ b/src/main/java/fr/univlille/sae/classification/model/LoadableData.java
@@ -50,18 +50,40 @@ public abstract class LoadableData {
     public static void setClassificationTypes(Set<String> classificationTypes) {
         LoadableData.classificationTypes = classificationTypes;
         LoadableData.classification.clear();
-
+        int nbOfColors = classificationTypes.size() + 1;
         int nb = 0;
         for(String s : classificationTypes) {
             // Génération de couleurs avec une plage évitant le blanc
 
-            LoadableData.classification.put(s, getColor(nb++));
+            LoadableData.classification.put(s, getColor(nb++, nbOfColors));
+        }
+
+        LoadableData.classification.put("undefined", getColor(nb,nbOfColors));
+    }
+
+
+    private static Color getColor(int nb, int totalColors) {
+        // Ratio pour répartir les couleurs uniformément
+        double ratio = (double) nb / (double) totalColors;
+
+        // Utilisation de fonctions trigonométriques pour des transitions douces
+        double red = 0.5 + 0.4 * Math.sin(2 * Math.PI * ratio); // Oscille entre 0.1 et 0.9
+        double green = 0.5 + 0.4 * Math.sin(2 * Math.PI * ratio + Math.PI / 3); // Décalage de phase
+        double blue = 0.5 + 0.4 * Math.sin(2 * Math.PI * ratio + 2 * Math.PI / 3); // Décalage de phase
+
+        // Réduction de la luminosité pour éviter le blanc et gris clair
+        double maxComponent = Math.max(red, Math.max(green, blue));
+        if (maxComponent > 0.8) {
+            red *= 0.8 / maxComponent;
+            green *= 0.8 / maxComponent;
+            blue *= 0.8 / maxComponent;
         }
 
-        LoadableData.classification.put("undefined", getColor(nb));
+        // Conversion en objet Color
+        return Color.color(red, green, blue);
     }
 
-    private static Color getColor(int i) {
+   /* private static Color getColor(int i) {
         double ratio = (double) i / classificationTypes.size();
 
         // Réduire les composantes pour éviter les tons clairs
@@ -73,6 +95,8 @@ public abstract class LoadableData {
     }
 
 
+    */
+
     /**
      * Définit la classification de l'objet.
      * @param classification classification à définir.
diff --git a/src/main/java/fr/univlille/sae/classification/utils/ViewUtil.java b/src/main/java/fr/univlille/sae/classification/utils/ViewUtil.java
index a0e92fd646fa93b58c4df0fe537e13a53da3292b..2217c066ed36bdc8b7c4522533f301623810569e 100644
--- a/src/main/java/fr/univlille/sae/classification/utils/ViewUtil.java
+++ b/src/main/java/fr/univlille/sae/classification/utils/ViewUtil.java
@@ -4,12 +4,14 @@ import fr.univlille.sae.classification.controller.DataStageController;
 import fr.univlille.sae.classification.controller.MainStageController;
 import fr.univlille.sae.classification.model.ClassificationModel;
 import fr.univlille.sae.classification.model.LoadableData;
+import javafx.geometry.Pos;
 import javafx.scene.chart.ScatterChart;
 import javafx.scene.chart.XYChart;
 import javafx.scene.control.ContextMenu;
 import javafx.scene.control.Label;
 import javafx.scene.control.MenuItem;
 import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
 import javafx.scene.paint.Color;
 import javafx.scene.shape.Circle;
 import javafx.scene.shape.Rectangle;
@@ -56,19 +58,46 @@ public class ViewUtil {
     }
 
 
-    public static HBox loadLegend() {
+    public static VBox loadLegend() {
         //Color
 
         Map<String, Color> colors = new HashMap<>(Map.copyOf(LoadableData.getClassifications()));
         Rectangle rectangle = new Rectangle(10, 10);
         rectangle.setFill(colors.remove("undefined"));
         Label label = new Label("undefined");
-        HBox hbox = new HBox();
+        VBox legend = new VBox();
+        legend.setAlignment(Pos.CENTER);
+        HBox line = new HBox();
+        line.setSpacing(10);
+        line.setAlignment(Pos.CENTER);
+
         HBox tempHBox = new HBox();
         tempHBox.getChildren().addAll(rectangle, label);
-        hbox.getChildren().add(tempHBox);
+        line.getChildren().add(tempHBox);
+
+        String[] colorsString = colors.keySet().toArray(new String[0]);
+        for(int i = 0 ; i < colorsString.length ; i+= 7) {
+            for(int j = 0 ; i+j < colorsString.length && j < i+7 ; j++) {
+                if(j%7 == 0 && i != 0 ) {
+                    legend.getChildren().add(line);
+                    line = new HBox();
+                    line.setSpacing(10);
+                    line.setAlignment(Pos.CENTER);
+                }
+
+                tempHBox = new HBox();
+                label = new Label(colorsString[i+j]);
+                rectangle = new Rectangle(10, 10);
+                rectangle.setFill(colors.get(colorsString[i+j]));
+                tempHBox.getChildren().addAll(rectangle, label);
+                line.getChildren().add(tempHBox);
 
+            }
+        }
+
+        if(colorsString.length < 7) legend.getChildren().add(line);
 
+/**
         for(String s : colors.keySet()) {
             Circle c = new Circle(5);
             c.setFill(colors.get(s));
@@ -78,8 +107,9 @@ public class ViewUtil {
 
             hbox.getChildren().add(tempHBox);
         }
+ */
 
-        return hbox;
+        return legend;
     }
 
 }
diff --git a/src/main/java/fr/univlille/sae/classification/view/DataStageView.java b/src/main/java/fr/univlille/sae/classification/view/DataStageView.java
index f14feab96b4523782dce473455a8e8182262d75a..dd613b18194e6ef2594f868ee0ea6ebcef707d4f 100644
--- a/src/main/java/fr/univlille/sae/classification/view/DataStageView.java
+++ b/src/main/java/fr/univlille/sae/classification/view/DataStageView.java
@@ -14,6 +14,7 @@ import javafx.scene.Node;
 import javafx.scene.chart.ScatterChart;
 import javafx.scene.chart.XYChart;
 import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
 import javafx.scene.shape.Circle;
 import javafx.scene.shape.Rectangle;
 import javafx.stage.Stage;
@@ -155,8 +156,8 @@ public class DataStageView extends DataVisualizationView implements Observer {
                 }
                 scatterChart.getData().addAll(serieList.values());
 
-                HBox hBox = ViewUtil.loadLegend();
-                controller.loadLegend(hBox);
+                VBox vBox = ViewUtil.loadLegend();
+                controller.loadLegend(vBox);
             }
         } catch (Exception e) {
             System.err.println("Erreur de mise à jour : " + e.getMessage());
@@ -199,8 +200,8 @@ public class DataStageView extends DataVisualizationView implements Observer {
                 series4.setName("indéfini");
                 scatterChart.getData().add(series4);
             }
-            HBox hBox = ViewUtil.loadLegend();
-            controller.loadLegend(hBox);
+            VBox vBox = ViewUtil.loadLegend();
+            controller.loadLegend(vBox);
         } catch (Exception e) {
             System.err.println("Erreur de mise à jour : " + e.getMessage());
         }
diff --git a/src/main/java/fr/univlille/sae/classification/view/MainStageView.java b/src/main/java/fr/univlille/sae/classification/view/MainStageView.java
index 39d6cb935722bf87d326a8dd611ede4a49267a0e..ad6aff4484f05d5f81889b3c0fc7c654e9bfe22e 100644
--- a/src/main/java/fr/univlille/sae/classification/view/MainStageView.java
+++ b/src/main/java/fr/univlille/sae/classification/view/MainStageView.java
@@ -13,6 +13,7 @@ import javafx.scene.chart.ScatterChart;
 import javafx.scene.chart.XYChart;
 import javafx.scene.control.*;
 import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
 import javafx.scene.shape.*;
 import javafx.stage.Stage;
 
@@ -169,8 +170,8 @@ public class MainStageView extends DataVisualizationView implements Observer {
                 scatterChart.getData().addAll(serieList.values());
 
 
-                HBox hBox = ViewUtil.loadLegend();
-                controller.loadLegend(hBox);
+                VBox vBox = ViewUtil.loadLegend();
+                controller.loadLegend(vBox);
             }