Search results

Ruler

Represents the Ruler component that measures the Diagram objects, indicate positions, and align Diagram elements.

<div id='ruler'>Show Ruler</div>
<script>
  var rulerObj = new Ruler({ showRuler: true });
  rulerObj.appendTo('#ruler');
</script>

Properties

arrangeTick

Function | string

Sets the segment width of the ruler.

Defaults to null

enablePersistence

boolean

Enable or disable persisting component’s state between page reloads.

Defaults to false

enableRtl

boolean

Enable or disable rendering component in right to left direction.

Defaults to false

interval

number

Defines the unique interval of the ruler.

Defaults to 5

length

number

Defines the length of the ruler.

Defaults to 400

locale

string

Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.

Defaults to

markerColor

string

Defines the color of the marker.

Defaults to ‘red’

orientation

string

Defines the orientation of the ruler.

Defaults to ‘Horizontal’

segmentWidth

number

Sets the segment width of the ruler.

Defaults to 100

thickness

number

Defines the thickness of the ruler.

Defaults to 25

tickAlignment

string

Defines the alignment of the tick in the ruler.

Defaults to ‘RightOrBottom’

Methods

addEventListener

Adds the handler to the given event listener.

Returns void

appendTo

Appends the control within the given HTML element

Parameter Type Description
selector (optional) string | HTMLElement Target element where control needs to be appended

Returns void

dataBind

When invoked, applies the pending property changes immediately to the component.

Returns void

destroy

To destroy the ruler

Returns void

getPersistData

Get the properties to be maintained in the persisted state.

Returns string

onPropertyChanged

Refreshes the ruler when the Ruler properties are updated

Returns void

refresh

Applies all the pending property changes and render the component again.

Returns void

removeEventListener

Removes the handler from the given event listener.

Returns void

Inject

Dynamically injects the required modules to the component.

Returns void