Bar with goal markers
Horizontal bars with target ticks.
Open the chart without page chrome ↗
const options = {
chart: {
height: 380,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "bar",
toolbar: {
show: false
}
},
series: [
{
name: "Actual",
data: [
{
x: "Platform",
y: 76,
goals: [
{
name: "Goal",
value: 83,
strokeWidth: 3,
strokeHeight: 14,
strokeColor: "#f59e0b",
strokeLineCap: "round"
}
]
},
{
x: "Payments",
y: 63,
goals: [
{
name: "Goal",
value: 71,
strokeWidth: 3,
strokeHeight: 14,
strokeColor: "#f59e0b",
strokeLineCap: "round"
}
]
},
{
x: "Search",
y: 57,
goals: [
{
name: "Goal",
value: 87,
strokeWidth: 3,
strokeHeight: 14,
strokeColor: "#f59e0b",
strokeLineCap: "round"
}
]
},
{
x: "Mobile",
y: 62,
goals: [
{
name: "Goal",
value: 83,
strokeWidth: 3,
strokeHeight: 14,
strokeColor: "#f59e0b",
strokeLineCap: "round"
}
]
},
{
x: "Data",
y: 62,
goals: [
{
name: "Goal",
value: 83,
strokeWidth: 3,
strokeHeight: 14,
strokeColor: "#f59e0b",
strokeLineCap: "round"
}
]
},
{
x: "Growth",
y: 65,
goals: [
{
name: "Goal",
value: 84,
strokeWidth: 3,
strokeHeight: 14,
strokeColor: "#f59e0b",
strokeLineCap: "round"
}
]
}
]
}
],
plotOptions: {
bar: {
horizontal: true,
barHeight: "55%",
borderRadius: 3
}
},
legend: {
show: true,
showForSingleSeries: true,
customLegendItems: ["Actual", "Goal"],
markers: {
fillColors: ["#2563eb", "#f59e0b"]
}
},
dataLabels: {
enabled: false
},
title: {
text: "OKR progress by team (%)"
},
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",
toolbar: {
show: false
}
},
series: [
{
name: "Actual",
data: [
{
x: "Platform",
y: 76,
goals: [
{
name: "Goal",
value: 83,
strokeWidth: 3,
strokeHeight: 14,
strokeColor: "#f59e0b",
strokeLineCap: "round"
}
]
},
{
x: "Payments",
y: 63,
goals: [
{
name: "Goal",
value: 71,
strokeWidth: 3,
strokeHeight: 14,
strokeColor: "#f59e0b",
strokeLineCap: "round"
}
]
},
{
x: "Search",
y: 57,
goals: [
{
name: "Goal",
value: 87,
strokeWidth: 3,
strokeHeight: 14,
strokeColor: "#f59e0b",
strokeLineCap: "round"
}
]
},
{
x: "Mobile",
y: 62,
goals: [
{
name: "Goal",
value: 83,
strokeWidth: 3,
strokeHeight: 14,
strokeColor: "#f59e0b",
strokeLineCap: "round"
}
]
},
{
x: "Data",
y: 62,
goals: [
{
name: "Goal",
value: 83,
strokeWidth: 3,
strokeHeight: 14,
strokeColor: "#f59e0b",
strokeLineCap: "round"
}
]
},
{
x: "Growth",
y: 65,
goals: [
{
name: "Goal",
value: 84,
strokeWidth: 3,
strokeHeight: 14,
strokeColor: "#f59e0b",
strokeLineCap: "round"
}
]
}
]
}
],
plotOptions: {
bar: {
horizontal: true,
barHeight: "55%",
borderRadius: 3
}
},
legend: {
show: true,
showForSingleSeries: true,
customLegendItems: ["Actual", "Goal"],
markers: {
fillColors: ["#2563eb", "#f59e0b"]
}
},
dataLabels: {
enabled: false
},
title: {
text: "OKR progress by team (%)"
},
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 bar-bar-with-markers.json --out bar-bar-with-markers.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/bar/bar-with-markers/index.md …