Lattice Grid Buy a licence

demo D215

Gantt

A row label with a start and an end, coloured by phase

type: 'gantt', label, start, end

Building…
Loading a live grid…

The configuration

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.27.0/lattice-grid.min.css">

<script type="module">
  import { defineLatticeGrid } from 'https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.27.0/modules/webcomponent.esm.js';
  defineLatticeGrid();
</script>

<div id="chart" style="height: 320px"></div>
<lattice-grid row-key="id" style="display: block; height: 320px; margin-top: 14px"></lattice-grid>

<script type="module">
  import { createChart } from 'https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.27.0/modules/charts.esm.min.js';

  const el = document.querySelector('lattice-grid');
  el.config = {
    columns: [
      { field: 'task',  title: 'Task', layout: { width: 160 } },
      { field: 'phase', title: 'Phase', filter: { type: 'set' } },
      { field: 'start', title: 'Start', type: 'date' },
      { field: 'end',   title: 'End',   type: 'date' },
    ],
  };
  el.rows = rows;  // e.g. [{ id: 1, task: 'Discovery', phase: 'Plan', start: '2026-01-06', end: '2026-01-14' }, ...]

  // Gantt reads a row label and a start and end date; series colours the bars.
  // The chart reads el.grid, the live grid inside the element.
  createChart({ grid: el.grid, container: '#chart', type: 'gantt',
    label: 'task', start: 'start', end: 'end', series: 'phase', legend: true });
</script>