Bullet-Diagramm
Ist-Balken im Vergleich zu Zielmarken und qualitativen Wertebereichen.
Diagramm ohne Website-Rahmen öffnen ↗
const options = {
chart: {
height: 360,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "bar",
toolbar: {
show: false
}
},
series: [
{
name: "Actual",
data: [
{
x: "Revenue",
y: 91,
goals: [
{
name: "Target",
value: 74,
strokeWidth: 3,
strokeHeight: 16,
strokeColor: "#0f172a"
}
]
},
{
x: "Profit",
y: 72,
goals: [
{
name: "Target",
value: 80,
strokeWidth: 3,
strokeHeight: 16,
strokeColor: "#0f172a"
}
]
},
{
x: "Avg. order",
y: 73,
goals: [
{
name: "Target",
value: 83,
strokeWidth: 3,
strokeHeight: 16,
strokeColor: "#0f172a"
}
]
},
{
x: "New customers",
y: 88,
goals: [
{
name: "Target",
value: 70,
strokeWidth: 3,
strokeHeight: 16,
strokeColor: "#0f172a"
}
]
},
{
x: "Satisfaction",
y: 87,
goals: [
{
name: "Target",
value: 89,
strokeWidth: 3,
strokeHeight: 16,
strokeColor: "#0f172a"
}
]
}
]
}
],
plotOptions: {
bar: {
horizontal: true,
barHeight: "36%",
borderRadius: 2
}
},
annotations: {
xaxis: [
{
x: 0,
x2: 50,
fillColor: "#94a3b8",
opacity: 0.18
},
{
x: 50,
x2: 75,
fillColor: "#94a3b8",
opacity: 0.1
}
]
},
xaxis: {
max: 100,
labels: {
formatter: (v) => v + '%'
}
},
legend: {
show: true,
customLegendItems: ["Actual", "Target"]
},
title: {
text: "KPI attainment vs target"
},
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: 360,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "bar",
toolbar: {
show: false
}
},
series: [
{
name: "Actual",
data: [
{
x: "Revenue",
y: 91,
goals: [
{
name: "Target",
value: 74,
strokeWidth: 3,
strokeHeight: 16,
strokeColor: "#0f172a"
}
]
},
{
x: "Profit",
y: 72,
goals: [
{
name: "Target",
value: 80,
strokeWidth: 3,
strokeHeight: 16,
strokeColor: "#0f172a"
}
]
},
{
x: "Avg. order",
y: 73,
goals: [
{
name: "Target",
value: 83,
strokeWidth: 3,
strokeHeight: 16,
strokeColor: "#0f172a"
}
]
},
{
x: "New customers",
y: 88,
goals: [
{
name: "Target",
value: 70,
strokeWidth: 3,
strokeHeight: 16,
strokeColor: "#0f172a"
}
]
},
{
x: "Satisfaction",
y: 87,
goals: [
{
name: "Target",
value: 89,
strokeWidth: 3,
strokeHeight: 16,
strokeColor: "#0f172a"
}
]
}
]
}
],
plotOptions: {
bar: {
horizontal: true,
barHeight: "36%",
borderRadius: 2
}
},
annotations: {
xaxis: [
{
x: 0,
x2: 50,
fillColor: "#94a3b8",
opacity: 0.18
},
{
x: 50,
x2: 75,
fillColor: "#94a3b8",
opacity: 0.1
}
]
},
xaxis: {
max: 100,
labels: {
formatter: (v) => v + '%'
}
},
legend: {
show: true,
customLegendItems: ["Actual", "Target"]
},
title: {
text: "KPI attainment vs target"
},
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 custom-series-bullet.json --out custom-series-bullet.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/custom-series/bullet/index.md …