Articles in this section
Category / Section

How to customize the ruler units in WPF Diagram (SfDiagram)?

The Ruler feature provides a horizontal and vertical guide for measuring in the WPF Diagram (SfDiagram) control. This feature can be used to measure the diagram objects, indicate positions, and align diagram elements. We have provided support to customize the ruler units. We have provided a code example to demonstrate this. Please refer to the code example below.

C#

// Adding Rulers
diagram.HorizontalRuler = new Ruler();
diagram.VerticalRuler = new Ruler() { Orientation = Orientation.Vertical };
// Customizing the Ruler Unit
(diagram.PageSettings.Unit as LengthUnit).Unit = LengthUnits.Inches;

 

WPF Diagram displays Ruler Unit

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