The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Finance::GeniusTrader::Graphics::Zone

A zone is a part of the graphic. It has an external size and an internal size. The internal size may be split in several sub zones.

   ________________
  |  ____________  |
  | |            | |
  | | Int.  zone | |
  | |____________| |
  |________________|

A zone can also be considered like a « drawable » object and as such it implements the display(...) method. It will call the display methods for the axis, draw the border if needed and draw the title.

Finance::GeniusTrader::Graphics::Zone->new($width, $height, $left, $right, $top, $bottom);

Creates a new zone with the given internal size. $left, $right, $top, $bottom is the free space to keep around the internal zone.

$z->add_subzone($zx, $zy, $zone)

Add $zone as a subzone of the current zone and place it at position ($zx,$zy). $zx and $zy are positive integers.

($ax, $ay) = $z->absolute_coordinate($x, $y)

Returns the absolute coordinate of the given point. ($x, $y) is the coordinate in the zone $z. ($ax, $ay) are the coordinate of the same point but in the root zone.

($x, $y) = $z->zone_coordinate($zx, $zy)

Returns the bottom left coordinate of the zone identified by ($zx, $zy). This function will only give good results once all zones have been created and linked together.

$z->update_size()

Update the size of the zone according to the size of the childs.

$z->get_subzone($zx, $zy)

Return the subzone indicated by the coordinate.

$z->set_axis_{left,right,top,bottom}($axis)

Put an axis on the indicated side.

$z->get_axis_{left,right,top,bottom}()

Get the axis of the indicated side.

$z->set_title_{left,right,top,bottom}($title)

Put a title on the indicated side.

$z->get_title_{left,right,top,bottom}()

Get the title of the indicated side.

$z->set_title_font_name($name)

$z->set_title_font_size($size)

$z->set_title_font_color($size)

Those 3 methods are used to change the font for the title.

$z->set_default_scale($scale)

Use $scale as the default scale for this zone.

$z->set_border_width($width)

Add a border of the given width around the zone. It will not sharp the zone but extend/decrease the space around it.

$z->set_border_color([$R,$G,$B])

Change the color of the border.

$z->includes_point($x, $y, [$extented])

Returns true if the point is within the zone, false otherwise. If $extended is true, the border of the zone is considered as part of the zone.

$z->display($driver, $graphic)

Display the zone with its axis, its borders and its titles.

SIMPLE FUNCTIONS

$z->width() && $z->height()

$z->external_width() && $z->external_height()

($x, $y) = $z->get_position()

$z->get_parent()

INTERNAL FUNCTIONS

$z->set_parent($parent)

$z->set_position($zx, $zy)

1 POD Error

The following errors were encountered while parsing the POD:

Around line 27:

Non-ASCII character seen before =encoding in '«'. Assuming CP1252