Line and column
Revenue columns with a margin line on a second axis.
Open the chart without page chrome ↗
const options = {
chart: {
height: 380,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "line",
toolbar: {
show: false
}
},
series: [
{
name: "Revenue k€",
type: "column",
data: [547, 314, 535, 384, 456, 435, 378, 423, 373, 405, 383, 331]
},
{
name: "Margin %",
type: "line",
data: [31.2, 29.4, 30.3, 29.1, 27.9, 27.4, 27.5, 26, 27.7, 28.5, 27.1, 27.2]
}
],
stroke: {
width: [0, 3]
},
xaxis: {
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
},
yaxis: [
{
title: {
text: "Revenue k€"
}
},
{
opposite: true,
title: {
text: "Margin %"
}
}
],
dataLabels: {
enabled: true,
enabledOnSeries: [1]
},
title: {
text: "Revenue and margin"
},
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: "line",
toolbar: {
show: false
}
},
series: [
{
name: "Revenue k€",
type: "column",
data: [547, 314, 535, 384, 456, 435, 378, 423, 373, 405, 383, 331]
},
{
name: "Margin %",
type: "line",
data: [31.2, 29.4, 30.3, 29.1, 27.9, 27.4, 27.5, 26, 27.7, 28.5, 27.1, 27.2]
}
],
stroke: {
width: [0, 3]
},
xaxis: {
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
},
yaxis: [
{
title: {
text: "Revenue k€"
}
},
{
opposite: true,
title: {
text: "Margin %"
}
}
],
dataLabels: {
enabled: true,
enabledOnSeries: [1]
},
title: {
text: "Revenue and margin"
},
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 mixed-line-column.json --out mixed-line-column.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/mixed/line-column/index.md …