Ansichtszustand speichern
plotOptions.gantt.persist: { key } speichert Ansicht (Zoom und Scrollposition), eingeklappte Gruppen und optional die Auswahl in localStorage und stellt sie beim nächsten Laden wieder her. Zoomen Sie oder klappen Sie eine Gruppe ein und laden Sie die Seite neu. api().clearSavedState() löscht den gespeicherten Zustand.
Diagramm ohne Website-Rahmen öffnen ↗Drawing width at least 1,024 px. Scroll within the chart on smaller screens.
const options = {
chart: {
height: "auto",
toolbar: {
show: false
},
type: "gantt"
},
series: [
{
name: "Discovery",
data: [
{
id: "res",
x: "Customer interviews",
y: [1788732000000, 1789682400000],
progress: 100,
assignee: "Iris",
baseline: [1788732000000, 1789509600000]
},
{
id: "req",
x: "Requirements",
y: [1789509600000, 1790287200000],
progress: 100,
dependsOn: ["res"],
assignee: "Hugo",
baseline: [1789336800000, 1790114400000]
},
{
id: "scope",
x: "Scope sign-off",
y: 1790546400000,
milestone: true,
dependsOn: ["req"]
}
]
},
{
name: "Design",
data: [
{
id: "flows",
x: "User flows",
y: [1790546400000, 1791496800000],
progress: 100,
dependsOn: ["scope"],
assignee: "Iris",
baseline: [1790546400000, 1791324000000]
},
{
id: "visual",
x: "Visual design",
y: [1791151200000, 1792533600000],
progress: 80,
dependsOn: ["flows"],
assignee: "Maya",
baseline: [1790805600000, 1792015200000]
},
{
id: "kit",
x: "Component kit",
y: [1790805600000, 1792101600000],
progress: 65,
dependsOn: ["scope"],
assignee: "Maya"
}
]
},
{
name: "Build",
data: [
{
id: "api",
x: "API & data model",
y: [1791151200000, 1793314800000],
progress: 50,
dependsOn: ["scope"],
assignee: "Tomas",
baseline: [1790805600000, 1792969200000]
},
{
id: "web",
x: "Web client",
y: [1792360800000, 1794524400000],
progress: 20,
dependsOn: ["visual", "kit"],
assignee: "Kira"
},
{
id: "int",
x: "Integrations",
y: [1793574000000, 1794524400000],
progress: 0,
dependsOn: ["api"],
assignee: "Tomas"
},
{
id: "qa",
x: "QA & hardening",
y: [1794783600000, 1795734000000],
progress: 0,
dependsOn: ["web", "int"],
assignee: "Nico"
},
{
id: "go",
x: "Launch",
y: 1795993200000,
milestone: true,
dependsOn: ["qa"]
}
]
}
],
plotOptions: {
gantt: {
today: {
date: "2026-10-22"
},
selection: {
enabled: true
},
persist: {
key: "wcc-gallery-gantt-state-v2",
selection: true
}
}
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()import WestCoastCharts from 'west-coast-charts'
import types from 'west-coast-charts/types'
import premium from 'west-coast-charts/premium'
WestCoastCharts.use(types).use(premium)
const WestCoastChartsPremium = premium
WestCoastCharts.setLicenseKey(LICENCE_KEY) // paid production licence; localhost evaluation needs no key
const options = {
chart: {
height: "auto",
toolbar: {
show: false
},
type: "gantt"
},
series: [
{
name: "Discovery",
data: [
{
id: "res",
x: "Customer interviews",
y: [1788732000000, 1789682400000],
progress: 100,
assignee: "Iris",
baseline: [1788732000000, 1789509600000]
},
{
id: "req",
x: "Requirements",
y: [1789509600000, 1790287200000],
progress: 100,
dependsOn: ["res"],
assignee: "Hugo",
baseline: [1789336800000, 1790114400000]
},
{
id: "scope",
x: "Scope sign-off",
y: 1790546400000,
milestone: true,
dependsOn: ["req"]
}
]
},
{
name: "Design",
data: [
{
id: "flows",
x: "User flows",
y: [1790546400000, 1791496800000],
progress: 100,
dependsOn: ["scope"],
assignee: "Iris",
baseline: [1790546400000, 1791324000000]
},
{
id: "visual",
x: "Visual design",
y: [1791151200000, 1792533600000],
progress: 80,
dependsOn: ["flows"],
assignee: "Maya",
baseline: [1790805600000, 1792015200000]
},
{
id: "kit",
x: "Component kit",
y: [1790805600000, 1792101600000],
progress: 65,
dependsOn: ["scope"],
assignee: "Maya"
}
]
},
{
name: "Build",
data: [
{
id: "api",
x: "API & data model",
y: [1791151200000, 1793314800000],
progress: 50,
dependsOn: ["scope"],
assignee: "Tomas",
baseline: [1790805600000, 1792969200000]
},
{
id: "web",
x: "Web client",
y: [1792360800000, 1794524400000],
progress: 20,
dependsOn: ["visual", "kit"],
assignee: "Kira"
},
{
id: "int",
x: "Integrations",
y: [1793574000000, 1794524400000],
progress: 0,
dependsOn: ["api"],
assignee: "Tomas"
},
{
id: "qa",
x: "QA & hardening",
y: [1794783600000, 1795734000000],
progress: 0,
dependsOn: ["web", "int"],
assignee: "Nico"
},
{
id: "go",
x: "Launch",
y: 1795993200000,
milestone: true,
dependsOn: ["qa"]
}
]
}
],
plotOptions: {
gantt: {
today: {
date: "2026-10-22"
},
selection: {
enabled: true
},
persist: {
key: "wcc-gallery-gantt-state-v2",
selection: true
}
}
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render() Warten auf das Diagramm.
Open Data & agent view to read this chart through chart.describe().
Aus der laufenden Bibliothek über das optionale agent/describe -Modul gelesen. Text, Tabelle und JSON zeigen denselben Zustand. Ausschließlich Demonstrationsdaten.
$ wcc chart export gantt-state-persistence.json --out gantt-state-persistence.svg --with-table Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm. Speichern Sie zuerst eine JSON-Spezifikation und prüfen Sie vor dem Rendern die geladene Runtime und die unterstützten Module. Befehlsreferenz
Loading /gallery/gantt/state-persistence/index.md … This example uses Premium modules. Compare licences · Embedding in a distributed product?