Line and area
An area of capacity with a line of demand.
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: "Capacity",
type: "area",
data: [68, 69, 72, 71, 73, 70, 69, 68, 67, 64, 65, 65, 66, 69]
},
{
name: "Demand",
type: "line",
data: [56, 51, 47, 47, 51, 50, 52, 50, 50, 47, 48, 52, 55, 54]
}
],
stroke: {
curve: "smooth",
width: [1, 3]
},
fill: {
type: ["gradient", "solid"],
gradient: {
opacityFrom: 0.4,
opacityTo: 0.05
}
},
xaxis: {
categories: ["D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D11", "D12", "D13", "D14"]
},
title: {
text: "Warehouse capacity vs demand"
},
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: "Capacity",
type: "area",
data: [68, 69, 72, 71, 73, 70, 69, 68, 67, 64, 65, 65, 66, 69]
},
{
name: "Demand",
type: "line",
data: [56, 51, 47, 47, 51, 50, 52, 50, 50, 47, 48, 52, 55, 54]
}
],
stroke: {
curve: "smooth",
width: [1, 3]
},
fill: {
type: ["gradient", "solid"],
gradient: {
opacityFrom: 0.4,
opacityTo: 0.05
}
},
xaxis: {
categories: ["D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D11", "D12", "D13", "D14"]
},
title: {
text: "Warehouse capacity vs demand"
},
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-area.json --out mixed-line-area.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-area/index.md …