首页 > 解决方案 > Want single link connection even there are Multiple links javascript NetChart

问题描述

I have a problem but can someone provide the example code, how to use multilinkProcessor for example I have the given data.

https://zoomcharts.com/developers/en/net-chart/api-reference/settings.html#doc_filters.multilinkProcessor

Want single link connection even there are Multiple links

var data = {
    "nodes": [{
        "id": "n1",
        "loaded": true,
        "style": {
            "label": "Node1"
        }
    }, {
        "id": "n2",
        "loaded": true,
        "style": {
            "label": "Node2"
        }
    }],
    "links": [{
        "id": "l1",
        "from": "n1",
        "to": "n2",
        "style": {
            "fillColor": "red",
            "toDecoration": "arrow"
        }
    }, {
        "id": "l11",
        "from": "n1",
        "to": "n2",
        "style": {
            "fillColor": "red",
            "toDecoration": "arrow"
        }
    }, {
        "id": "l111",
        "from": "n1",
        "to": "n2",
        "style": {
            "fillColor": "red",
            "toDecoration": "arrow"
        }
    }, {
        "id": "l114",
        "from": "n1",
        "to": "n2",
        "style": {
            "fillColor": "red",
            "toDecoration": "arrow"
        }
    }]
};

var t = new NetChart({
    container: document.getElementById("demo"),
    area: {
        height: 350
    },
    data: {
        preloaded: data
    },
    info: {
        enabled: true,
        linkContentsFunction: function(data, link, callback) {
            return link.id;
        }
    }
});

标签: javascripthtmlcss

解决方案


推荐阅读