windowsforms-devexpress-dot-xtradiagram-dot-options-dot-diagramoptionsview-de9f27b2.md
Specifies the unit of measurement to use in UI.
Namespace : DevExpress.XtraDiagram.Options
Assembly : DevExpress.XtraDiagram.v25.2.dll
NuGet Package : DevExpress.Win.Diagram
[DefaultValue(typeof(MeasureUnit), "Pixels")]
[DiagramCategory(DiagramCategory.Options)]
public virtual MeasureUnit MeasureUnit { get; set; }
<DefaultValue(GetType(MeasureUnit), "Pixels")>
<DiagramCategory(DiagramCategory.Options)>
Public Overridable Property MeasureUnit As MeasureUnit
| Type | Default | Description |
|---|---|---|
| MeasureUnit | "Pixels" |
A unit of measure.
|
You can access this nested property as listed below:
| Object Type | Path to MeasureUnit |
|---|---|
| DiagramControl |
.OptionsView .MeasureUnit
|
Set the ShowMeasureUnit property to true to use the unit of measurement in the Properties Panel and Bottom Panel.
If the ShowMeasureUnit property is set to false , the MeasureUnit value only affects the ruler’s unit of measurement and values in the Page Setup Window. The Properties Panel and Bottom Panel display values in pixels.
The illustration below shows a diagram with the MeasureUnit property set to Inches.
ShowMeasureUnit = true
ShowMeasureUnit = false
The ShowRulers property specifies whether the diagram rulers are visible.
The following measurement units are available:
You can create a custom MeasureUnit and assign it as the MeasureUnit value.
private static TickStepsData[] CentimetersStepsTable = new TickStepsData[] {
new TickStepsData(0.01, 100.0, 5, 10),
new TickStepsData(0.02, 50.0, 5, 10),
new TickStepsData(0.03, 30.0, 2, 10),
new TickStepsData(0.06, 20.0, 2, 10),
new TickStepsData(0.12, 15.0, 2, 10),
new TickStepsData(0.2, 10.0, 2, 10),
new TickStepsData(0.25, 5.0, 2, 10),
new TickStepsData(0.3, 5.0, 2, 8),
new TickStepsData(0.4, 5.0, 2, 4),
new TickStepsData(0.5, 2.5, 2, 8),
new TickStepsData(0.8, 2.0, 2, 10),
new TickStepsData(1.0, 1.0, 2, 10),
new TickStepsData(1.5, 1.0, 2, 8),
};
public static readonly MeasureUnit Centimeters =
new MeasureUnit(DevExpress.XtraPrinting.GraphicsDpi.Millimeter, 10, "Centimeters", CentimetersStepsTable, () => "cm");
Private Shared CentimetersStepsTable() As TickStepsData = {
New TickStepsData(0.01, 100.0, 5, 10),
New TickStepsData(0.02, 50.0, 5, 10),
New TickStepsData(0.03, 30.0, 2, 10),
New TickStepsData(0.06, 20.0, 2, 10),
New TickStepsData(0.12, 15.0, 2, 10),
New TickStepsData(0.2, 10.0, 2, 10),
New TickStepsData(0.25, 5.0, 2, 10),
New TickStepsData(0.3, 5.0, 2, 8),
New TickStepsData(0.4, 5.0, 2, 4),
New TickStepsData(0.5, 2.5, 2, 8),
New TickStepsData(0.8, 2.0, 2, 10),
New TickStepsData(1.0, 1.0, 2, 10),
New TickStepsData(1.5, 1.0, 2, 8)
}
Public Shared ReadOnly Centimeters As New MeasureUnit(DevExpress.XtraPrinting.GraphicsDpi.Millimeter,
10, "Centimeters", CentimetersStepsTable, Function() "cm")
See Also