Hi,
I have a DiagramComponent that works fine, except I can't get the FitPage() to work.
I have a button that creates the DiagramComponent - it calls code like this:
// create connectors and nodes...
// then...
await traceDiagram?.DoLayout();
FitOptions fitOptions = new FitOptions()
{
Mode = FitMode.Both,
Region = DiagramRegion.PageSettings
};
traceDiagram?.FitToPage(fitOptions);
The diagram does not fit to the page, it remains too large to see everything in the viewport.
I have tried moving FitPage() before DoLayout() also, but that doesn't fit the page either.
If I create another button that lets me fit to page after the diagram is rendered then that works (the button calls traceDiagram.FitToPage() ). But I want the diagram to be fitted when it is first rendered.
What am I doing wrong? Should FitPage() be executed at some other time?
Thanks.