New Product Launch - BoldDesk !
Introducing help desk ticketing software.
New Product LaunchBoldDesk: Help desk ticketing software starts at $10 for 3 agents.
Try it for free.
Query |
Response |
|
Please use fitToPage method which fits the diagram content within the viewport. We have created a sample in which we have called a fitToPage method at the button click. Could you please check in the below sample? Still if you face any issues, please share us more details such as modify the below sample.
|
|
Could you please elaborate your requirement in detail with the screenshot or video. So that we can validate and provide a solution. |
WebAPI
public List<HierarchicalTree> Get()
{
DiagramEntities3 entity = new DiagramEntities3();
List<HierarchicalTree> HierarchicalData = entity.HierarchicalTrees.ToList<HierarchicalTree>();
return HierarchicalData;
}
Angular
ngOnInit(): void {
const callback: Ajax = new Ajax(
'http://localhost:57270/api/entity/Get', 'GET', false, 'application/json; charset=utf-8'
);
callback.onSuccess = (JsonString: any): void => {
let diagramInstance= this;
setTimeout( function () {
//set an diagram layout
diagramInstance.diagram.layout = {
type: 'HierarchicalTree', verticalSpacing: 30, horizontalSpacing: 40,
enableAnimation: true
}
//get a layout tree from database
let parsedData = JSON.parse(JsonString);
//set datasource
diagramInstance.diagram.dataSourceSettings = {
id: 'Name', parentId: 'Category',
dataManager: new DataManager(parsedData),
doBinding: (nodeModel: NodeModel, data: object, diagram: Diagram) => {
nodeModel.shape = { type: 'Basic', shape:'Rectangle' };
nodeModel.annotations = [{content: (data as EmployeeInfo).Name}]
}
}
},100)
};
callback.send().then();
} |
|
public scrollSettings: ScrollSettingsModel = { minZoom: 0.01 }; |