Back

NetChart with data function

A data function example with incremental loading. Chart call data function when new nodes are about to be displayed.

Documentation Open in JSFiddle
Start Free Trial Purchase

HTML

HTML
<script src="https://cdn.zoomcharts-cloud.com/1/nightly/zoomcharts.js"></script>

<div id="demo"></div>

CSS

CSS
//No CSS for this example 

JavaScript

JavaScript

    var t = new NetChart({
        container: document.getElementById("demo"),
        area: { height: null },
        data:
        {
            dataFunction: function(nodeList, success, error){
                // using jquery for ajax call
                //return just the first node, net chart will ask for more
                jQuery.ajax({
                    url:"/dvsl/data/net-chart/friend-net/"+nodeList[0]+".json",
                    success: success,
                    error: error});
            }
        },
        navigation:{
            initialNodes:["m-1"],
            mode:"manual"
        },
        style: {
            node: {
                fillColor: "rgba(47,195,47,1)"
            },
            link: {
                fillColor: "rgba(176,220,11,0.6)"
            }
        }

    });

Data

Data
//No separate data for this example