Network Graph

Overview

Network graph is a mathematical structure (graph) to show relations between points. The graph visualizes how entities are interconnected with each other. Entities are displayed as nodes (points) and the relationship between them (edges) are displayed with lines.

Modules

The Network Graph diagram requires adding the Core and Network Graph modules:

<script src="https://cdn.anychart.com/releases/8.6.0/js/anychart-core.min.js"></script>
<script src="https://cdn.anychart.com/releases/8.6.0/js/anychart-graph.min.js"></script>

Learn more: Modules.

Quick Start

To create a Graph chart, use the anychart.graph() chart constructor, like in the following sample:

// create data
var data = {
  nodes: [
    {id: 'n'}, {id: 'n1'}, {id: 'n2'}, {id: 'n3'}, {id: 'n4'}, {id: 'n5'}, {id: 'n6'},
  ],
  edges: [
    {from: 'n', to: 'n1'},
    {from: 'n', to: 'n2'},
    {from: 'n', to: 'n3'},
    {from: 'n', to: 'n4'},
    {from: 'n', to: 'n5'},
    {from: 'n', to: 'n6'},
  ]
};
// create a chart and set the data
var chart = anychart.graph(data);

// set the container id
chart.container('container')

// initiate drawing the chart  
chart.draw();

Here is a live sample:

Playground