Bars and Trend Lines in One Glance: Introducing Column Overlays for CanvasXpress Area Graphs
▶ TrendPlot (stacked bars over a stacked area)▶ TrendPlot (percent-stacked, scale_y)
Area graphs are great at showing how a stacked quantity evolves across categories, but they can blur the exact value at any single category — the eye follows the slope, not the point. Bar charts are the opposite problem: great for precise category values, poor at showing the overall trend across the row. Analysts who need both at once have historically reached for two separate charts, or a manual overlay hack.
CanvasXpress now closes that gap natively. With two new configuration options on the Area graph type — areaShowColumns and areaColumnWidth — you can render a semi-transparent stacked (or percent-scaled) area band with discrete column marks sitting right on top of it, all from a single chart object. The result is a "trend plot": the readability of a bar chart fused with the shape-at-a-glance clarity of an area chart.
Why this matters
If you've ever built a dashboard showing, say, daily session counts broken out by channel, you've probably wanted both of these views simultaneously:
- The bars tell you exactly how many sessions came from each channel on a given day.
- The area behind them tells you, without any cognitive math, whether the total and the mix are trending up, down, or holding steady.
Previously in CanvasXpress you'd have had to choose graphType: "Stacked" for the bars or graphType: "Area" for the band — not both. Now a single Area chart can show both layers, because the column overlay reuses the exact stacked coordinates the area geometry already computes. There's no coordinate drift between the bars and the band behind them; they are, by construction, the same numbers rendered twice.
How to use it
The feature is additive to the existing Area graph type. You don't need a new graph type or a different data shape — just turn on areaShowColumns in your configuration, alongside whatever areaType and areaStyle you already use.
var data = {
y: {
vars: ["Organic", "Paid", "Referral"],
smps: ["Mon", "Tue", "Wed", "Thu", "Fri"],
data: [
[120, 132, 101, 134, 90],
[60, 72, 85, 70, 95],
[40, 38, 45, 50, 42]
]
}
};
var config = {
graphType: "Area",
areaType: "stacked",
areaStyle: "translucent",
areaShowColumns: true,
areaColumnWidth: 0.6
};
var cx = new CanvasXpress("chartCanvas", data, config);
That's it. areaType: "stacked" keeps the segments additive, areaStyle: "translucent" keeps the band legible so the columns read clearly against it, and areaShowColumns: true is the switch that tells CanvasXpress to draw a solid column at each category — centered in its slot, sized by areaColumnWidth (a 0–1 fraction of the available space; it defaults to 0.6 if you omit it).
Want proportions instead of absolute totals — the classic "100% stacked" trend view? Just swap areaType to "percent":
var config = {
graphType: "Area",
areaType: "percent",
areaStyle: "translucent",
areaShowColumns: true
};
Every category's bars and the band behind them will now sum to 100%, so you can read both the exact channel mix per day and how that mix shifts across the week.
It composes, it doesn't collide
A deliberate design choice here: the column overlay is its own independent switch, not a new value bolted onto areaType or areaStyle. That means areaShowColumns works with any existing area configuration — stacked or overlapping, solid, translucent, or outlined — without introducing a special-case combination you have to memorize. If you're already comfortable configuring Area charts in CanvasXpress, there's nothing new to learn except the one flag that turns the columns on.
This also means nothing changes for charts that don't opt in. areaShowColumns defaults to false, so every area chart you've already built — plain, stacked, percent, translucent, or outlined — renders exactly as it did before. You have to ask for the column overlay explicitly.
Fine-tuning and iterating
Because areaShowColumns and areaColumnWidth are ordinary configuration properties, they work with the rest of the CanvasXpress configuration workflow you already know. You can toggle and tune them live from the Customizer's Area Graphs section — right alongside the other area-style controls like fill style and stacking mode — and see the chart redraw instantly. If you're scripting changes instead of clicking through the UI, the same properties apply through updateConfig:
cx.updateConfig({ areaShowColumns: true, areaColumnWidth: 0.5 }, true);
Once you have a trend plot configured the way you like, the chart's toolbar lets you save the full configuration as JSON so you — or a teammate — can drag that file back onto any CanvasXpress container and reload the exact same visualization later. The same toolbar also offers a reproduce action that walks back through how the chart was constructed, which is handy when you're documenting a dashboard or sharing a recipe with colleagues.
A small feature with an outsized payoff
Trend plots are a small addition to the Area graph type's surface area, but they solve a genuinely common visualization need: showing precise category-level values and the overall shape of change in the same glance, without maintaining two charts or hand-rolling an overlay. Whether you're tracking marketing channels, sensor categories, or survey responses across time, give areaShowColumns a try the next time an area chart feels like it's hiding the numbers, or a bar chart feels like it's hiding the trend.