Gruppierte gestapelte Säule
Budget- und Ist-Stapel je Quartal nebeneinander.
Diagramm ohne Website-Rahmen öffnen ↗
const options = {
chart: {
height: 380,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "bar",
stacked: true,
toolbar: {
show: false
}
},
series: [
{
name: "Budget · People",
group: "budget",
data: [51, 57, 52, 55]
},
{
name: "Budget · Tools",
group: "budget",
data: [18, 20, 18, 19]
},
{
name: "Actual · People",
group: "actual",
data: [57, 45, 61, 41]
},
{
name: "Actual · Tools",
group: "actual",
data: [20, 21, 22, 10]
}
],
xaxis: {
categories: ["Q1", "Q2", "Q3", "Q4"]
},
colors: ["#2563eb", "#93c5fd", "#0d9488", "#5eead4"],
plotOptions: {
bar: {
columnWidth: "60%"
}
},
dataLabels: {
enabled: false
},
title: {
text: "Budget vs actual (k€)"
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()import WestCoastCharts from 'west-coast-charts'
const options = {
chart: {
height: 380,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "bar",
stacked: true,
toolbar: {
show: false
}
},
series: [
{
name: "Budget · People",
group: "budget",
data: [51, 57, 52, 55]
},
{
name: "Budget · Tools",
group: "budget",
data: [18, 20, 18, 19]
},
{
name: "Actual · People",
group: "actual",
data: [57, 45, 61, 41]
},
{
name: "Actual · Tools",
group: "actual",
data: [20, 21, 22, 10]
}
],
xaxis: {
categories: ["Q1", "Q2", "Q3", "Q4"]
},
colors: ["#2563eb", "#93c5fd", "#0d9488", "#5eead4"],
plotOptions: {
bar: {
columnWidth: "60%"
}
},
dataLabels: {
enabled: false
},
title: {
text: "Budget vs actual (k€)"
},
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 column-grouped-stacked-column.json --out column-grouped-stacked-column.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/column/grouped-stacked-column/index.md …