User Guide

Ruby Component
Dashes
Pens can be set to draw broken rather than solid lines. Y can do this using the setDashStyle method of the Pen object.
setDashStyle type
The method takes a single input. This can be either an index or a string:
0 or “none” No dash is applied, instead you get the default solid line
1 or “dash” A dashed line
2 or “dot” A dotted line
3 or “dashdot” A line comprised of alternating dashes and dots
4 or “dashdotdot” A line comprised of alternating dashes and double dots
The example below shows a selection of these styles.
Dash Caps
You can set the way that ends of the dashes and dots are drawn by using the setDashCaps method.
setDashCaps type
There are only 3 options for the type:
0, 1 or “flat” The ends are flat, dots are squares – this is the default option
2 or “round” The ends are rounded, dots are circles
2 or “triangle” The ends are pointed, dots are diamonds
143 of 212