Node:arrow, Next:, Previous:text_box, Up:Top



Arrows

Arrow is an optional component of a chart that draws line segments with an arrowhead. To draw an arrow, one creates an arrow.T object, and calls its "draw" method usually after area.draw() is called (otherwise, area.draw() may overwrite the arrow). For example, the below code draws an arrow from (10,10) to (20,30).

ar = area.T(...)
a = arrow.T(head_style = 1)
ar.draw()
a.draw([(10,10), (20,30)])

head_color type: color.T Attribute
Default: color.black. The color of the arrow head. See color.

head_len type: number Attribute
Default: 8. The length of the arrow head.

head_style type: int Attribute
Default: 1. The value of 0 draws a triangular arrow head. 1 draws a swallow-tail arrow head

line_style type: line_style.T Attribute
Default: line_style.black. Line style. See line_style.

thickness type: number Attribute
Default: 4. The width of the arrow head.

An arrow object exports a single public method, draw.

arrow.T:draw SELF POINTS Method
Points: The list of points the arrow traverses. It should contain at least two points, i.e., the tail and tip. CAN is an optional parameter that specifies the output. See canvas.
arrows.png