Abhängigkeiten bearbeiten
dependencies.edit: Einen Balken mit dem Mauszeiger ansteuern und am runden Griff an seinem Ende ziehen, um ihn mit einem anderen Balken zu verknüpfen (Ende-zu-Anfang). Zum Entfernen einen Link anklicken und Delete drücken. Tastatur: Eine Aufgabe fokussieren und L drücken, zu einer anderen Aufgabe wechseln und erneut L drücken (bei einem bereits verknüpften Paar löst ein weiterer Druck die Verknüpfung). Schleifen werden abgewiesen. Ctrl/Cmd+Z macht die Änderung rückgängig. dependencyCreate / dependencyDelete lassen sich abbrechen und schreiben dependsOn in Ihre Daten zurück.
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",
events: {
dependencyCreate: (e, ctx, o) => log('dependencyCreate ' + o.from + ' → ' + o.to + ' (' + o.source + ')'),
dependencyDelete: (e, ctx, o) => log('dependencyDelete ' + o.from + ' → ' + o.to + ' (' + o.source + ')')
}
},
series: [
{
name: "Release",
data: [
{
id: "a",
x: "Design",
y: [1791151200000, 1791756000000],
progress: 100
},
{
id: "b",
x: "Build",
y: [1791756000000, 1792706400000],
progress: 30,
dependsOn: ["a"]
},
{
id: "c",
x: "Docs",
y: [1791928800000, 1792533600000]
},
{
id: "t",
x: "Test",
y: [1792706400000, 1793142000000]
},
{
id: "e",
x: "Release",
y: 1793314800000,
milestone: true,
dependsOn: ["b"]
}
]
}
],
plotOptions: {
gantt: {
today: {
date: "2026-10-22"
},
drag: {
enabled: true
},
dependencies: {
edit: 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",
events: {
dependencyCreate: (e, ctx, o) => log('dependencyCreate ' + o.from + ' → ' + o.to + ' (' + o.source + ')'),
dependencyDelete: (e, ctx, o) => log('dependencyDelete ' + o.from + ' → ' + o.to + ' (' + o.source + ')')
}
},
series: [
{
name: "Release",
data: [
{
id: "a",
x: "Design",
y: [1791151200000, 1791756000000],
progress: 100
},
{
id: "b",
x: "Build",
y: [1791756000000, 1792706400000],
progress: 30,
dependsOn: ["a"]
},
{
id: "c",
x: "Docs",
y: [1791928800000, 1792533600000]
},
{
id: "t",
x: "Test",
y: [1792706400000, 1793142000000]
},
{
id: "e",
x: "Release",
y: 1793314800000,
milestone: true,
dependsOn: ["b"]
}
]
}
],
plotOptions: {
gantt: {
today: {
date: "2026-10-22"
},
drag: {
enabled: true
},
dependencies: {
edit: 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-dependency-edit.json --out gantt-dependency-edit.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/dependency-edit/index.md … This example uses Premium modules. Compare licences · Embedding in a distributed product?