blazorise

How to show organization chart with Z.Blazor.Diagrams package


I'm using Z.Blazor.Diagrams package version 2.0.0 in my blazorise .Net core 5 client side project to create and show an organization chart. every thing is working fine and I can create my chart, my problem is how to show my graph in the format of organization chart. I've searched but didn't find any way. this is part of my code to show the chart:

double x = 0;
    double y = 0;
    foreach (var item in chartDetail)
    {
        var node = NewNode(x, y, item.PostTitle, item.Id);
        Diagram.Nodes.Add(new[] { node });
        x += 100;
        y += 100;
    }

I'll appreciate it if any one can help.


Solution

  • I solved it by saving position in database. On every node movement point(x,y) changes so I create the chart in the shape that I want and show it just same as created