How to add padding in canvas area in diagram

After we scroll in diagram, diagram moves up and gets stick at top. We want to add some padding at top.

Please find  image for reference



Is there any way to add padding at top.


1 Reply

SG Shyam G Syncfusion Team July 13, 2022 02:47 PM UTC

Hi Rohit,


You can set a scrollSettings padding property to achieve your requirement. The scrollbar is updated based on the scrollSettings padding value set at initial rendering. Please refer to a code example and the sample for your reference.


Code example:


<ejs-diagram

          #diagram

          id="diagram"

          width="100%"

          height="700px"

          [scrollSettings]="scrollSettings">


  public scrollSettings: ScrollSettingsModel = {

    padding: {top: 20, bottom: 20, right: 20, left:20}

  }


Sample: https://stackblitz.com/edit/angular-h6s3jy?file=app.component.ts,app.component.html


Regards,

Shyam G


Loader.
Up arrow icon