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



Annotation

arrows type: list Attribute
Default: pychart_util.new_list. The list of arrows. Not to be touched by the user directly

bottom_fudge type: number Attribute
Default: 5. The amount of space below the last line

fill_style type: fill_style.T Attribute
Default: fill_style.white. The fill style. See fill_style.. See fill_style.

left_fudge type: number Attribute
Default: 5. The amount of space left of the box

line_style type: line_style.T Attribute
Default: line_style.black. The line style of the surrounding frame. See line_style.. See line_style.

loc type: tuple Attribute
Default: (0, 0). The location of the text box.

radius type: number Attribute
Default: 0. Radius of the four corners of the rectangle. If the value is zero, a sharp-cornered rectangle is drawn.

right_fudge type: number Attribute
Default: 5. The amount of space right of the box

shadow type: (xoff,yoff,fill) Attribute
Default: None. The value is either None or a tuple. When non-None, a drop-shadow is drawn beneath the object. X-off, and y-off specifies the offset of the shadow relative to the object, and fill specifies the style of the shadow (see fill_style).

text type: str Attribute
Default: "???". Text body. See font.

top_fudge type: number Attribute
Default: 0. The amount of space (in points) above the first line

In addition to the above attributes, it provides the following methods.

text_box.T:add_arrow TIP, TAIL=None, ARROW=arrow.default Method
This method adds a straight arrow that points to TIPLOC, which is a tuple of integers. TAIL specifies the starting point of the arrow. It is either None or a string consisting of the following letters: 'l', 'c', 'r', 't', 'm,', and 'b'. Letters 'l', 'c', or 'r' means to start the arrow from the left, center, or right of the text box, respectively. Letters 't', 'm', or 'b' means to start the arrow from the top, middle or bottom of the text box. For example, when tail = 'tc' then arrow is drawn from top-center point of the text box. ARROW specifies the style of the arrow. See arrow.
annotations.png

Annotations example

Below is the source code that produces the above chart. ../demos/annotations.py

from pychart import *

a1 = text_box.T(loc=(100,100), text="Without frame")
a1.add_arrow((50, 100))
a1.add_arrow((180, 100))
a1.draw()

a1 = text_box.T(loc=(100,130), text="/hCMulti\n/bLine")
a1.add_arrow((50, 120))
a1.add_arrow((180, 100))
a1.draw()

a1 = text_box.T(loc=(100,160), text="Fat arrow", line_style=None)
a1.add_arrow((180, 140), tail='rm', arrow = arrow.fat1)
a1.draw()

a1 = text_box.T(loc=(180, 100), text="/a90Funny background",
                fill_style = fill_style.gray70)
a1.draw()

a1 = text_box.T(loc=(180, 140), text="/hL/20Big/oText\n/24/bHuge/oText",
                fill_style = None)
a1.draw()