Borders

Borders are used to decorate the edges of the plotting area in a chart. Borders can be used to frame the plotting area; add tickmarks to a chart; or annotate a chart with labels, titles and captions.

none

toolbox.new_border('none'[, <padding>])

A border which does nothing. Can be used as a placeholder where a border is expected.

See Padding for more information on padding.

Tickable borders

The following border objects can decorate a chart with tick marks from a tickset. For more information on creating and using ticksets, see Tick Sets.

hline

toolbox.new_border('hline'[, ticksets, line, y_offset=0, <padding>])

Draws a horizontal line on the border.

If supplied, ticksets is a an iterable of tick sets that will be drawn along the border. Tick sets may be added after object creation with the add_tickset method.

If supplied, line is is a line that will be drawn horizontally across the width of the border.

If supplied, y_offset describes how far from the top of the border region the line will be drawn. With a y_offset of 0, the line will be drawn on the top edge of the border region; with a y_offset of 1, it will be drawn at the bottom.

padding represents zero or more padding arguments. (See Padding for more information on padding.)

add_tickset(tickset)

Adds tickset to the tick sets that will be drawn on this border. Tick sets will be drawn in the order in which they are added.

iter_ticksets()

Returns an iterator over the tick sets stored in this object.

get_tickset(idx)

Returns the tick set stored at idx.

horizontal

toolbox.new_border('horizontal'[, ticksets, <padding>])

Draws a simple horizontal border with no decoration.

If supplied, ticksets is a an iterable of tick sets that will be drawn along the border. Tick sets may be added after object creation with the add_tickset method.

padding represents zero or more padding arguments. (See Padding for more information on padding.)

add_tickset(tickset)

Adds tickset to the tick sets that will be drawn on this border. Tick sets will be drawn in the order in which they are added.

iter_ticksets()

Returns an iterator over the tick sets stored in this object.

get_tickset(idx)

Returns the tick set stored at idx.

vline

toolbox.new_border('vline'[, ticksets, line, y_offset=0, <padding>])

Draws a vertical line on the border.

If supplied, ticksets is a an iterable of tick sets that will be drawn along the border. Tick sets may be added after object creation with the add_tickset method.

If supplied, line is is a line that will be drawn vertically across the height of the border.

If supplied, x_offset describes how far from the right edge of the border region the line will be drawn. With a x_offset of 0, the line will be drawn on the far right edge of the border region; with a x_offset of 1, it will be drawn on the far left edge.

padding represents zero or more padding arguments. (See Padding for more information on padding.)

add_tickset(tickset)

Adds tickset to the tick sets that will be drawn on this border. Tick sets will be drawn in the order in which they are added.

iter_ticksets()

Returns an iterator over the tick sets stored in this object.

get_tickset(idx)

Returns the tick set stored at idx.

vertical

toolbox.new_border('vertical'[, ticksets, <padding>])

Draws a simple vertical border with no decoration.

If supplied, ticksets is a an iterable of tick sets that will be drawn along the border. Tick sets may be added after object creation with the add_tickset method.

padding represents zero or more padding arguments. (See Padding for more information on padding.)

add_tickset(tickset)

Adds tickset to the tick sets that will be drawn on this border. Tick sets will be drawn in the order in which they are added.

iter_ticksets()

Returns an iterator over the tick sets stored in this object.

get_tickset(idx)

Returns the tick set stored at idx.

Labeled borders

Labeled borders are used to add axis labels, titles, and captions to charts.

hlabel

toolbox.new_border('hlabel', label[, font_size="normal", font_family="default", font_style="normal", font_weight="normal", halign="center", valign="center", color="black", <padding>])

Draws a single static text label (e.g., a title or caption) horizontally in a border.

label is the text label to apply to the border.

font_size, font_family and font_style take the values described in Specifying Text Properties.

angle is an optional angle of rotation, relative to the label’s default horizontal, left-to-right orientation.

halign and valign specify, respectively, the horizontal and vertical alignment of the label within the border region.

color is the color in which to draw the text.

padding represents zero or more padding arguments. (See Padding for more information on padding.)

vlabel

toolbox.new_border('vlabel', label[, font_size="normal", font_family="default", font_style="normal", font_weight="normal", halign="center", valign="center", color="black", <spacing_args>])

Draws a single static text label (e.g., a title or caption) vertically in a border.

label is the text label to apply to the border.

font_size, font_family and font_style take the values described in Specifying Text Properties.

angle is an optional angle of rotation, relative to the label’s default vertical, bottom-to-top orientation.

halign and valign specify, respectively, the horizontal and vertical alignment of the label within the border region.

color is the color in which to draw the text.

padding represents zero or more padding arguments. (See Padding for more information on padding.)

Split borders

Split borders subdivide a border into two equally-sized subdivisions. Each subdivision can, itself, contain another border. This can be used in some situations to introduce vertical or horizontal alignment where it is not otherwise natural to do so using the normal layout mechanism.

Note

It is normally a better idea to use the layout facilities documented in Charts to achieve layout effects; split borders are useful, however, for aligning elements across the layout sections of a chart. (Even then, data and scales should be used if the alignment naturally arises from the data; these classes should only be used to align elements with purely presentational layout, such as the width of columns.)

hsplit

toolbox.new_border('hsplit', children[, <padding>])

Draws a horizontal border, split into cells arranged from top to bottom. Each contains a child border, which is drawn on the portion of the region allocated to it.

children is a list of borders which will be drawn in the subregions, from left to right. There will be as many subregions as there are children.

padding represents zero or more padding arguments. (See Padding for more information on padding.)

vsplit

toolbox.new_border('vsplit', children[, <padding>])

Draws a vertical border, split into cells arranged from left to right. Each contains a child border, which is drawn on the portion of the region allocated to it.

children is a list of borders which will be drawn in the subregions, from left to right. There will be as many subregions as there are children.

padding represents zero or more padding arguments. (See Padding for more information on padding.)