Column and line
Compare measures using columns and lines, such as Sales as columns and Profit as a line.
Chart ID: columnLine. Independent import: @revolist/charts/column-line.
Live example
Section titled “Live example”Loading chart…
Reading the chart
Section titled “Reading the chart”Compare independent column, line, area or scatter layers on the same category/time axis. A secondary Y axis can express another unit, but its scale changes how the series appear together.
Data requirements
Section titled “Data requirements”Use one category per row and one or more numeric series. Values are finite numbers or explicit nulls; the row mapper does not group or aggregate repeated keys.
The roles below describe the chart's data contract. Generic category/value roles resolve from the dataset; explicitly bind specialized numeric roles as shown in the complete example.
| Data role | Field count |
|---|---|
category | 1 or more |
value | 1 or more |
series | 2 or more |
Download the complete sample data and settings (JSON). See Data & Configuration for mapping, null values, updates and lifecycle rules.
Create this chart
Section titled “Create this chart”Install the package using the installation guide, give the host an explicit height, and call createColumnLineChart after the host mounts. This factory fixes the chart type to columnLine.
<div id="chart" style="width: 100%; height: 450px;"></div>Complete runnable TypeScript example with sample data
import { createColumnLineChart } from '@revolist/charts/column-line';
const container = document.getElementById('chart')!;const chart = await createColumnLineChart({ container, "dataset": { "revision": 0, "source": "client", "categories": [ { "id": "preview-category-0", "label": "Jan", "path": [ "Jan" ], "labels": [ "Jan" ], "depth": 1, "kind": "leaf" }, { "id": "preview-category-1", "label": "Feb", "path": [ "Feb" ], "labels": [ "Feb" ], "depth": 1, "kind": "leaf" }, { "id": "preview-category-2", "label": "Mar", "path": [ "Mar" ], "labels": [ "Mar" ], "depth": 1, "kind": "leaf" }, { "id": "preview-category-3", "label": "Apr", "path": [ "Apr" ], "labels": [ "Apr" ], "depth": 1, "kind": "leaf" } ], "series": [ { "id": "preview-series-0", "label": "Actual", "columnPath": [ "Actual" ], "labels": [ "Actual" ], "kind": "leaf", "prop": "preview-0" }, { "id": "preview-series-1", "label": "Target", "columnPath": [ "Target" ], "labels": [ "Target" ], "kind": "leaf", "prop": "preview-1" }, { "id": "preview-series-2", "label": "Forecast", "columnPath": [ "Forecast" ], "labels": [ "Forecast" ], "kind": "leaf", "prop": "preview-2" } ], "values": [ [ 32, 24, 28 ], [ 51, 38, 42 ], [ 43, 49, 46 ], [ 68, 56, 61 ] ], "analyticalFrame": { "fields": [ { "id": "pivot:category", "label": "pivot:category", "role": "dimension", "semanticType": "category" }, { "id": "pivot:series", "label": "pivot:series", "role": "dimension", "semanticType": "category" }, { "id": "preview-series-0", "label": "Actual", "role": "measure", "semanticType": "number", "sourceField": "preview-0" }, { "id": "preview-series-1", "label": "Target", "role": "measure", "semanticType": "number", "sourceField": "preview-1" }, { "id": "preview-series-2", "label": "Forecast", "role": "measure", "semanticType": "number", "sourceField": "preview-2" } ], "observations": [ { "id": "[\"preview-category-0\",\"preview-series-0\"]", "dimensions": { "pivot:category": { "value": "Jan", "label": "Jan", "path": [ "Jan" ], "labels": [ "Jan" ] }, "pivot:series": { "value": "Actual", "label": "Actual", "path": [ "Actual" ], "labels": [ "Actual" ] } }, "measures": { "preview-series-0": 32 } }, { "id": "[\"preview-category-0\",\"preview-series-1\"]", "dimensions": { "pivot:category": { "value": "Jan", "label": "Jan", "path": [ "Jan" ], "labels": [ "Jan" ] }, "pivot:series": { "value": "Target", "label": "Target", "path": [ "Target" ], "labels": [ "Target" ] } }, "measures": { "preview-series-1": 24 } }, { "id": "[\"preview-category-0\",\"preview-series-2\"]", "dimensions": { "pivot:category": { "value": "Jan", "label": "Jan", "path": [ "Jan" ], "labels": [ "Jan" ] }, "pivot:series": { "value": "Forecast", "label": "Forecast", "path": [ "Forecast" ], "labels": [ "Forecast" ] } }, "measures": { "preview-series-2": 28 } }, { "id": "[\"preview-category-1\",\"preview-series-0\"]", "dimensions": { "pivot:category": { "value": "Feb", "label": "Feb", "path": [ "Feb" ], "labels": [ "Feb" ] }, "pivot:series": { "value": "Actual", "label": "Actual", "path": [ "Actual" ], "labels": [ "Actual" ] } }, "measures": { "preview-series-0": 51 } }, { "id": "[\"preview-category-1\",\"preview-series-1\"]", "dimensions": { "pivot:category": { "value": "Feb", "label": "Feb", "path": [ "Feb" ], "labels": [ "Feb" ] }, "pivot:series": { "value": "Target", "label": "Target", "path": [ "Target" ], "labels": [ "Target" ] } }, "measures": { "preview-series-1": 38 } }, { "id": "[\"preview-category-1\",\"preview-series-2\"]", "dimensions": { "pivot:category": { "value": "Feb", "label": "Feb", "path": [ "Feb" ], "labels": [ "Feb" ] }, "pivot:series": { "value": "Forecast", "label": "Forecast", "path": [ "Forecast" ], "labels": [ "Forecast" ] } }, "measures": { "preview-series-2": 42 } }, { "id": "[\"preview-category-2\",\"preview-series-0\"]", "dimensions": { "pivot:category": { "value": "Mar", "label": "Mar", "path": [ "Mar" ], "labels": [ "Mar" ] }, "pivot:series": { "value": "Actual", "label": "Actual", "path": [ "Actual" ], "labels": [ "Actual" ] } }, "measures": { "preview-series-0": 43 } }, { "id": "[\"preview-category-2\",\"preview-series-1\"]", "dimensions": { "pivot:category": { "value": "Mar", "label": "Mar", "path": [ "Mar" ], "labels": [ "Mar" ] }, "pivot:series": { "value": "Target", "label": "Target", "path": [ "Target" ], "labels": [ "Target" ] } }, "measures": { "preview-series-1": 49 } }, { "id": "[\"preview-category-2\",\"preview-series-2\"]", "dimensions": { "pivot:category": { "value": "Mar", "label": "Mar", "path": [ "Mar" ], "labels": [ "Mar" ] }, "pivot:series": { "value": "Forecast", "label": "Forecast", "path": [ "Forecast" ], "labels": [ "Forecast" ] } }, "measures": { "preview-series-2": 46 } }, { "id": "[\"preview-category-3\",\"preview-series-0\"]", "dimensions": { "pivot:category": { "value": "Apr", "label": "Apr", "path": [ "Apr" ], "labels": [ "Apr" ] }, "pivot:series": { "value": "Actual", "label": "Actual", "path": [ "Actual" ], "labels": [ "Actual" ] } }, "measures": { "preview-series-0": 68 } }, { "id": "[\"preview-category-3\",\"preview-series-1\"]", "dimensions": { "pivot:category": { "value": "Apr", "label": "Apr", "path": [ "Apr" ], "labels": [ "Apr" ] }, "pivot:series": { "value": "Target", "label": "Target", "path": [ "Target" ], "labels": [ "Target" ] } }, "measures": { "preview-series-1": 56 } }, { "id": "[\"preview-category-3\",\"preview-series-2\"]", "dimensions": { "pivot:category": { "value": "Apr", "label": "Apr", "path": [ "Apr" ], "labels": [ "Apr" ] }, "pivot:series": { "value": "Forecast", "label": "Forecast", "path": [ "Forecast" ], "labels": [ "Forecast" ] } }, "measures": { "preview-series-2": 61 } } ], "matrixCells": [ { "categoryId": "preview-category-0", "seriesId": "preview-series-0", "observationId": "[\"preview-category-0\",\"preview-series-0\"]", "measureFieldId": "preview-series-0" }, { "categoryId": "preview-category-0", "seriesId": "preview-series-1", "observationId": "[\"preview-category-0\",\"preview-series-1\"]", "measureFieldId": "preview-series-1" }, { "categoryId": "preview-category-0", "seriesId": "preview-series-2", "observationId": "[\"preview-category-0\",\"preview-series-2\"]", "measureFieldId": "preview-series-2" }, { "categoryId": "preview-category-1", "seriesId": "preview-series-0", "observationId": "[\"preview-category-1\",\"preview-series-0\"]", "measureFieldId": "preview-series-0" }, { "categoryId": "preview-category-1", "seriesId": "preview-series-1", "observationId": "[\"preview-category-1\",\"preview-series-1\"]", "measureFieldId": "preview-series-1" }, { "categoryId": "preview-category-1", "seriesId": "preview-series-2", "observationId": "[\"preview-category-1\",\"preview-series-2\"]", "measureFieldId": "preview-series-2" }, { "categoryId": "preview-category-2", "seriesId": "preview-series-0", "observationId": "[\"preview-category-2\",\"preview-series-0\"]", "measureFieldId": "preview-series-0" }, { "categoryId": "preview-category-2", "seriesId": "preview-series-1", "observationId": "[\"preview-category-2\",\"preview-series-1\"]", "measureFieldId": "preview-series-1" }, { "categoryId": "preview-category-2", "seriesId": "preview-series-2", "observationId": "[\"preview-category-2\",\"preview-series-2\"]", "measureFieldId": "preview-series-2" }, { "categoryId": "preview-category-3", "seriesId": "preview-series-0", "observationId": "[\"preview-category-3\",\"preview-series-0\"]", "measureFieldId": "preview-series-0" }, { "categoryId": "preview-category-3", "seriesId": "preview-series-1", "observationId": "[\"preview-category-3\",\"preview-series-1\"]", "measureFieldId": "preview-series-1" }, { "categoryId": "preview-category-3", "seriesId": "preview-series-2", "observationId": "[\"preview-category-3\",\"preview-series-2\"]", "measureFieldId": "preview-series-2" } ] } }, "bindings": {}, "presentation": { "dataLabels": false }});
// When the host unmounts:// chart.destroy();Await updates before reading a snapshot or exporting. Call chart.destroy() when the host unmounts. See the live catalog to interact with this type.
Supported options
Section titled “Supported options”Set these fields in chartOptions. The option schema validates supported keys, ranges and choices; updating chartOptions replaces that authored object.
| Option | Default | Accepted values |
|---|---|---|
showGridLines | true | true or false |
markOpacity | 1 | 0.2 to 1; step 0.05 |
strokeWidth | 2 | 1 to 6; step 0.5 |
sampling | auto | auto, none, m4, minmax, lttb |
disableLineItemHighlight | false | true or false |
stackOrder | none | none, reverse, ascending, descending, appearance |
stackOffset | diverging | diverging, none, expand |
normalizeStacks | false | true or false |
normalizedTo | 100 | 1 to 1000000; step 1 |
Titles, legends, theme and labels belong to presentation or the corresponding top-level setting. Axis, color, navigation and interaction support depends on the selected chart; see Data & Configuration.
Related charts
Section titled “Related charts”- Area and line — Compare measures using a filled area and lines, such as Sales as an area and Profit as a line.
Charts overview · Installation · Data & Configuration
Normalized column stacks
Section titled “Normalized column stacks”Set chartOptions.normalizeStacks: true and assign column layers the same stackGroup to normalize their positive and negative contributions independently. chartOptions.normalizedTo defaults to 100 (range 1 through 1,000,000). Raw source tooltips/CSV and noncolumn layers retain their values. See normalization domains, navigator behavior and Pivot controls.
Grouped area and line layers
Section titled “Grouped area and line layers”Column, area and line layers accept seriesOverrides[id].stackGroup. Area/line groups share cumulative paths independently of column groups; normalizeStacks and normalizedTo apply to both families. See sign boundaries, sampling, axes and Pivot controls.
Stack order
Section titled “Stack order”Use chartOptions.stackOrder or seriesOverrides[id].stackOrder to choose source, reverse, total-based or peak-appearance accumulation while preserving source identities. See policies, per-stack overrides and Pivot controls.
Per-series curves
Section titled “Per-series curves”Use seriesOverrides[id].interpolation to choose linear, legacy smooth, directional/midpoint steps, monotone X/Y, natural, Catmull–Rom or bump X/Y curves. Combination charts accept this on line/area layers. See all curve choices, defaults and Pivot controls.
Set seriesOverrides[id].connectNulls: true to join finite path endpoints across null values. It defaults to false and preserves explicit calendar gaps. See null connections, viewport behavior and Pivot controls.
Fill baseline
Section titled “Fill baseline”Unstacked areas accept seriesOverrides[id].baseline: number | 'min' | 'max'. Numeric baselines participate in the automatic domain; endpoint policies use the final axis bounds. See baseline options and Pivot controls.
Source markers
Section titled “Source markers”Use seriesOverrides[id].markers: true | false | 'start' | 'end' for all, hidden or accepted-frame endpoint glyphs. Marker shapes include cross, star and wye alongside the four existing choices. See marker modes, sampling and Pivot controls.
Application code can refine those modes with rendererOptions.markers.isVisible(context). See runtime source predicates and sampling.
Path sampling
Section titled “Path sampling”chartOptions.sampling accepts 'auto' (default), 'none', 'm4', 'minmax',
and 'lttb'. See path sampling for
budgets, stacked-edge alignment, viewport behavior, and marker handling.
Step endpoints
Section titled “Step endpoints”seriesOverrides[id].strictStepCurve defaults to false. Stepped paths expand
across categorical bands; true retains exact observation endpoints. Default
native point layouts and numeric/time axes keep their existing geometry. Explicit
category band placement enables expansion for native line/area paths. See step endpoint policy
for combination bands, null runs, sampling, areas, and Pivot controls.
Category placement
Section titled “Category placement”axes.x.categoryPlacement and axes.xAxes[id].categoryPlacement accept 'point'
or 'band' for categorical X axes. Omitted settings keep native line/area point
positions and combination band centers. Band placement enables expanded native
steps; point placement retains exact stepped endpoints. See
category point and band placement
for singletons, column margins, grouped labels, selection, preview, save/SSR and
Pivot controls.
Transient point highlights
Section titled “Transient point highlights”chartOptions.disableLineItemHighlight and
seriesOverrides[id].disableHighlight default to false. Highlights inspect
source observations independently of regular marker visibility/predicates and
can temporarily replace saved endpoint glyphs. See
transient source-point highlights
for nearest-source policy, tooltip/focus/activation limits, snapshots and Pivot
controls.
Source keyboard inspection
Section titled “Source keyboard inspection”Line/area observations omitted by marker settings, runtime predicates or sampling remain reachable through the chart’s single inspection Tab stop. Arrow keys wrap; Home/End select the first/last item and Enter/Space use raw source activation. Null, hidden and clipped observations are excluded. See source-point keyboard traversal for ordering, focus rings, updates and inspection-only derived values.
Stack baselines
Section titled “Stack baselines”Set chartOptions.stackOffset or a stack member’s stackOffset to diverging
(default), none or expand. Expansion uses algebraic unit totals and keeps raw
source inspection. See supported partitions, signed values, defaults and limits.
Bubble and histogram layers
Section titled “Bubble and histogram layers”Set seriesOverrides[id].type to 'bubble' or 'histogram' in this combination.
A bubble owner supplies raw Y and requires bubble: { x, size } with source
measure IDs. A histogram owner supplies samples and requires histogram: {} or
an explicit bin/metric policy. Bound helpers remain canonical fields and do not
become implicit line layers. Sample-owned layers require numeric X; use named
axes when other layers use categorical/time X or different numeric units.
Bins retain complete intervals under navigation. Bubble activation retains the real X/Y/size observation; aggregate bins do not invent raw records. Saved layer order, named axes, shared tooltips, complete-source validation, data views and Pivot authoring use the shared combination owner. Native SVG is supported; batched/GPU equivalence and combination per-datum encoding are not provided. See all sample-layer options and limitations.