Skip to content

Line ​

Trends over an ordered domain – one polyline per series.

Identity ​

chartTypeline
Option bagline
seriesData layoutseriesRows – row 0 = category header; later rows = series
Min grid2 rows × 2 columns (header included)
OrientationYes – vertical (default) or horizontal
SampleLine · Dual-axis line

Minimal chartData ​

js
{
  chartType: 'line',
  isDataTransposed: true,
  seriesData: [
    ['', 'Jan', 'Feb', 'Mar', 'Apr'],
    ['Visits', 120, 132, 128, 150],
  ],
  title: { visible: true, text: 'Weekly visits' },
  subtitle: { visible: false, text: '' },
  legend: { visible: false },
}

seriesData ​

Same seriesRows layout as clustered bar (with isDataTransposed: true):

js
[
  ['', 'Jan', 'Feb', 'Mar', 'Apr'],
  ['Visits', 120, 132, 128, 150],
  ['Signups', 40, 44, 41, 55],
]
RuleDetail
Row 0Ordered domain labels (categories / periods)
Later rowsOne series each
Empty / null cellsBreaks in the line for that point (intentional gaps)

Shared layout rules: chartData schema · seriesData.


Option bag: line ​

Only chartType: 'line' reads cd.line. Stacked areas use the separate area bag.

FieldDefault (new charts)Role
width2Stroke width (px)
strokeDashArray''Dash pattern (SVG-style string)
drawPointsfalseShow point markers on the line
curveParameter0.85Curve tension (editor Smoothness control)
shadowIntensity0Soft shadow under the stroke
pointMarkersee belowMarker style when drawPoints is on
overrides{}Indexed style patches

Leave curveType at its default ('cardinal'). Prefer adjusting curveParameter (editor Smoothness) rather than swapping interpolation names.

Point markers ​

Rendered only when drawPoints: true. Resolution order: per-point override → per-series → global pointMarker.

js
{
  chartType: 'line',
  seriesData: [/* … */],
  line: {
    width: 2.5,
    drawPoints: true,
    curveParameter: 0.85,
    pointMarker: {
      shape: 'circle', // circle | square | diamond | triangle
      radius: 3,
      fill: null,      // null = series color
      stroke: '#ffffff',
      strokeWidth: 1,
    },
  },
}

Full marker surface: Point markers.


Axes & scales ​

RoleVertical (default)Horizontal
Domainbottomleft
Primary rangeleftbottom
Secondary rangerighttop
  • Dual-axis is fully supported on line charts: enable the secondary range axis and set boundSeries to the series indices that use it.
  • Setting the range axis with customMin / customMax is normal (unlike bars, which bias toward including zero).
  • Pair tick formats and preferredTickInterval with the side that holds the range role after orientation.

Details: Axes · Secondary · Axes · by chart type · Dual-axis line sample.

js
{
  chartType: 'line',
  isDataTransposed: true,
  seriesData: [
    ['', 'Q1', 'Q2', 'Q3', 'Q4'],
    ['Revenue', 120, 140, 155, 170],
    ['Margin %', 18, 19, 21, 20],
  ],
  axes: {
    right: {
      id: 'secondaryRange',
      enabled: true,
      visible: true,
      boundSeries: [1],
      labels: {
        preferredTickInterval: 5,
        numberFormat: {
          mode: 'custom',
          customFormat: {
            prefix: '',
            postfix: '%',
            thousandSeparator: ',',
            decimalSeparator: '.',
            decimalPlaces: 0,
            forceDecimals: false,
            signDisplay: 'auto',
            scaleDown: 0,
          },
        },
      },
    },
  },
}

Type-specific behaviour ​

  • Series color still comes from legend.colors.
  • Markers stay off until line.drawPoints: true (or you turn them on in the editor).
  • For bar + line on one chart, use combo with combo.seriesTypes – do not put bar options in cd.line.
  • Area fills belong on stackedArea / cd.area, not on line.

Pitfalls ​

  • Expecting markers without drawPoints: true
  • Putting area/bar fields on line (foreign-option-bag)
  • Binding secondary with the wrong series index after reordering rows
  • Forcing bar-style “must include zero” when a tighter range-axis span is what you want – set customMin / customMax deliberately (Value axis)
  • Using stackedArea defaults/area bag when you only wanted a stroke

Developer documentation for Chartbuddy Embed · Not the end-user Help Center · Help Center