Skip to content

Lines ​

Straight, smooth or stepped lines. A null leaves a gap, and a dashed series recalls last year.

Code ​

ts
createChart(host, {
  type: "xy",
  categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  legend: true,
  series: [
    {
      name: "2026",
      data: [80, 95, 106, 110, 106, 98, 88, 80, 79, 85, 98, 113]
    },
    {
      name: "2025",
      data: [70, 82, 91, 94, 91, 84, 76, 70, 69, 74, 85, 97],
      dashed: true
    }
  ]
});

Smooth, with a target and a note ​

ts
createChart(host, {
  type: "xy",
  categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  xTitle: "Month",
  axes: [
    {
      title: "Orders"
    }
  ],
  lines: [
    {
      value: 75,
      label: "Target 75"
    }
  ],
  annotations: [
    {
      at: "May",
      value: 84,
      text: "New shop"
    }
  ],
  series: [
    {
      name: "Orders",
      data: [60, 73, 83, 87, 84, 76, 67, 60, 59, 65, 76, 90],
      curve: "smooth",
      dots: false
    }
  ]
});

Steps and gaps ​

ts
createChart(host, {
  type: "xy",
  categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug"],
  series: [
    {
      name: "Price",
      data: [10, 10, 12, null, 14, 18, 18, 20],
      curve: "step",
      showLabel: true
    }
  ]
});

Every field is in the API. Change this chart in the playground.

MIT License