Bullet
Actual bars against target ticks and qualitative ranges.
Open the chart without page chrome ↗
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() Waiting for the chart.
Open Data & agent view to read this chart through chart.describe().
Read from the running library through its optional agent/describe module. Text, table and JSON share the same snapshot. Demo data only.
$ 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. Save a JSON spec first and check the loaded runtime and supported modules before rendering. Command reference
Loading /gallery/custom-series/bullet/index.md …