Articles in this section
Category / Section

How to change diagram gridlines as dotted lines in Angular Diagram?

2 mins read

This article explains how to change diagram gridlines to dotted lines in an Angular diagram. Gridlines are a pattern of lines drawn behind the Angular Diagram elements, providing visual guidance while dragging or arranging objects on the diagram surface. The snapSettings property is used to customize the gridlines and control the snapping behavior in the diagram. By specifying the gridType as “Dots,” you can render the diagram gridlines as dots.

The horizontalGridLines and the verticalGridLines properties allow you to customize the appearance of the horizontal and vertical gridlines, respectively. The lineColor and lineDashArray properties are used to customize the line color and line style of the gridlines. The dotIntervals property specifies the interval between the gridlines. With the help of the code snippet below, you can change the gridlines to dotted lines.

app.component.html

<ejs-diagram
 #diagram
 id="diagram"
 width="100%"
 height="700px"
 [snapSettings]="snapSettings"
>
</ejs-diagram>

app.component.ts

 public snapSettings: SnapSettingsModel = {
   horizontalGridlines: {  lineColor: 'black',
   dotIntervals: [1.5, 20, 1.5, 20, 1.5, 20, 1.5, 20, 1.5, 20]},
   verticalGridlines: {  dotIntervals: [1.5, 20, 1.5, 20, 1.5, 20] },
   gridType: 'Dots'
 };

Refer to the working sample for additional details and implementation: Sample

Conclusion

We hope you enjoyed learning about how to change diagram gridlines as dotted lines in Angular Diagram.

You can refer to our Angular Diagram feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our Angular Diagram example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls. If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied