> Markdown version of [Gantt](https://vaadin.com/docs/latest/fr/components/charts/charttypes/gantt). Section index: [llms.txt](https://vaadin.com/docs/latest/fr/components/llms.txt)

# <a id="charts.charttypes.gantt"></a>Graphiques Gantt

Un graphique Gantt est un type de graphique à barres qui visualise un planning de projet. Il affiche les dates de début et de fin des différents éléments d’un projet et aide à visualiser la chronologie du projet, les dépendances entre les tâches, et l’avancement.

Le graphique Gantt nécessite des instances de `GanttSeriesItem` pour représenter les tâches. Chaque `GanttSeriesItem` peut éventuellement avoir un statut d’achèvement pour indiquer l’avancement de la tâche (propriété `completed`) et des dépendances sur d’autres éléments (propriété `dependency`).

Un graphique Gantt prêt à l’emploi est présenté dans [Exemple de graphique Gantt](#figure.charts.charttypes.gantt).

[Image: charts gantt]

Exemple de graphique Gantt

Un graphique Gantt est activé avec `ChartType.GANTT`. Vous pouvez effectuer des réglages spécifiques au type dans l’objet `PlotOptionsGantt`. Pour des informations plus détaillées sur la configuration du graphique Gantt, voir [Graphique Gantt](https://vaadin.com/docs/latest/fr/components/charts/gantt.md).

```java
  // Create a Gantt chart
Chart chart = new Chart(ChartType.GANTT);

// Modify the default configuration
final Configuration configuration = chart.getConfiguration();
configuration.setTitle("Gantt Chart with Progress Indicators");

// Configure the axes - set timeline boundaries
XAxis xAxis = configuration.getxAxis();
xAxis.setMin(Instant.parse("2014-10-17T00:00:00Z"));
xAxis.setMax(Instant.parse("2014-10-30T00:00:00Z"));
PlotOptionsGantt plotOptionsGantt = new PlotOptionsGantt();
configuration.setPlotOptions(plotOptionsGantt);

// Add data
GanttSeries series = new GanttSeries();
series.setName("Project 1");
final GanttSeriesItem startPrototype = new GanttSeriesItem(
        "Start prototype",
        Instant.parse("2014-10-18T00:00:00Z"),
        Instant.parse("2014-10-25T00:00:00Z"));
startPrototype.setCompleted(0.25);
series.add(startPrototype);

series.add(new GanttSeriesItem(
        "Test prototype",
        Instant.parse("2014-10-27T00:00:00Z"),
        Instant.parse("2014-10-29T00:00:00Z")));

final GanttSeriesItem develop = new GanttSeriesItem(
        "Develop",
        Instant.parse("2014-10-20T00:00:00Z"),
        Instant.parse("2014-10-25T00:00:00Z"));
develop.setCompleted(new Completed(0.12, SolidColor.ORANGE));
series.add(develop);

series.add(new GanttSeriesItem(
        "Run acceptance tests",
        Instant.parse("2014-10-23T00:00:00Z"),
        Instant.parse("2014-10-26T00:00:00Z")));
configuration.addSeries(series);
```

## <a id="exemple-de-gantt"></a>Exemple de Gantt

**Flow** — `ChartTypeGantt.java`

```java
// Create a Gantt chart
Chart chart = new Chart(ChartType.GANTT);

// Modify the default configuration
final Configuration configuration = chart.getConfiguration();
configuration.setTitle("Gantt Chart with Progress Indicators");

// Configure the axes - set timeline boundaries
XAxis xAxis = configuration.getxAxis();
xAxis.setMin(Instant.parse("2014-10-17T00:00:00Z"));
xAxis.setMax(Instant.parse("2014-10-30T00:00:00Z"));
PlotOptionsGantt plotOptionsGantt = new PlotOptionsGantt();
configuration.setPlotOptions(plotOptionsGantt);

// Add data
GanttSeries series = new GanttSeries();
series.setName("Project 1");
final GanttSeriesItem startPrototype = new GanttSeriesItem(
        "Start prototype", Instant.parse("2014-10-18T00:00:00Z"),
        Instant.parse("2014-10-25T00:00:00Z"));
startPrototype.setCompleted(0.25);
series.add(startPrototype);

series.add(new GanttSeriesItem("Test prototype",
        Instant.parse("2014-10-27T00:00:00Z"),
        Instant.parse("2014-10-29T00:00:00Z")));

final GanttSeriesItem develop = new GanttSeriesItem("Develop",
        Instant.parse("2014-10-20T00:00:00Z"),
        Instant.parse("2014-10-25T00:00:00Z"));
develop.setCompleted(new Completed(0.12, SolidColor.ORANGE));
series.add(develop);

series.add(new GanttSeriesItem("Run acceptance tests",
        Instant.parse("2014-10-23T00:00:00Z"),
        Instant.parse("2014-10-26T00:00:00Z")));
configuration.addSeries(series);
```
