Introduction

The KeyLines chart is the container for items that are used to build a graph and visualise your data. The main items in graph visualisations are nodes, links and annotations.

All items can have sub-items with additional information. For example, all items can have labels and glyphs, nodes can have halos and donuts, and links can have arrows.

a simple KeyLines chart showing examples of items and sub-items

The chart itself can also contain different styling or navigation elements such as logos, watermarks, navigation controls or overview window.

Creating charts

To create a chart, call the KeyLines.create() function:

KeyLines.create({ container: 'div1' })
  .then((result) => {
    chart = result;
  });

Make sure that you wait for KeyLines.create() to finish before calling other chart functions such as chart.load(). See Asynchronous JavaScript for more details.

You can display multiple charts on one page, as illustrated in the Path Analysis in Trees demo.

For detailed guides on creating an app with KeyLines, take a look at our JavaScript, React, Angular, Vue, Webpack or Rollup tutorials.

Styling charts

a corner of KeyLines chart showing navigation controls in dark mode

Nodes, links and annotations can all be styled in many ways to achieve virtually any design.

For various examples, see:

The chart itself has a range of customisable options available in the chart options API Reference, for example:

To help accelerate the design and build of branded graph visualisations that fit seamlessly into your application UI, download our free Figma Design Kit.

Loading data into charts

There are a few different options how to load data into your chart. See Loading Data for details on how to do this.