Rulers in WPF Diagram (SfDiagram)

11 Jan 20241 minute to read

The Ruler provides a Horizontal and Vertical guide for measuring in the Diagram control. The Ruler can be used to measure the Diagram objects, indicate positions, and align Diagram elements. This is especially useful in creating scale models. You can set the unit of measure, such as centimeters or inches. The default Unit of measure is pixels.

Please refer to the sample from Dashboard->Desktop->WPF->Diagram->GettingStarted->Rulers and Units.

Define Rulers


<syncfusion:SfDiagram x:Name="diagram">
        <syncfusion:Ruler Orientation="Vertical"/>
diagram.HorizontalRuler = new Ruler();
diagram.VerticalRuler = new Ruler() { Orientation = Orientation.Vertical };


Customizing the Ruler

By default, ruler segments are arranged based on the MeasurementUnit. See the available LengthUnits for Ruler.

Segment width, the textual description of the ruler segment, and the appearance of the ruler ticks can be customized.


Please refer to the sample to Customize the Ruler.

See Also

How to customize the ruler units?