How to create network graph or hierarchical tree using visjs in angularjs?

后端 未结 1 1813
北海茫月
北海茫月 2021-01-28 23:04

I need some help in creating a network graph using visjs in angularjs. I am working on this plunker to achieve something like this

I followed the steps mentioned in Angu

相关标签:
1条回答
  • 2021-01-28 23:22

    I saw a few issues. First, you were including your css files as scripts instead of as stylesheets. So use this:

    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.3.0/vis.css">
    <link rel="stylesheet" type="text/css" href="style.css">
    

    Second if you take a look at angular-vis.js, you'll see that the directive should actually be vis-timeline. So I just changed it to this in the html:

    <vis-timeline data="data" options="options"></vis-timeline>
    

    I removed the events attribute because that wasn't defined on your scope, but I assume you can look at the visjs documentation to see what should go there.

    See the revised plunker for the whole fix.

    0 讨论(0)
提交回复
热议问题