NAME

StatusBoard::Graph::DataSeq - datasequences representation for the StatusBoard::Graph

VERSION

version 1.0.1

SYNOPSIS

use StatusBoard::Graph::DataSeq;

my $ds = StatusBoard::Graph::DataSeq->new();
$ds->set_title("X-Cola");
$ds->set_values(
    [
        2008 => 22,
        2009 => 24,
        2010 => 25.5,
        2011 => 27.9,
        2012 => 31,
    ]
);

DESCRIPTION

This is and class StatusBoard::Graph::DataSeq that is used in StatusBoard::Graph.

METHODS

new

This a constuctor. It creates StatusBoard::Graph object. It don't need any parameters.

my $ds = StatusBoard::Graph::DataSeq->new();

set_title

Sets title for the datasequences. This parameter is mandatory.

$ds->set_title("X-Cola");

get_title

Returns the title of the object or dies if there is no title.

set_color

Sets the color for the datasequence. Color values can be yellow, green, red, purple, blue, mediumGray, pink, aqua, orange, or lightGray.

If the color is not set then StatusBoard App will choose the color randomly.

has_color

Returns bool value if the color is set.

get_color

Returns the color or dies if no color is set.

set_values

Sets the values for the datasequence. The method shuold recieve arrayref with pairs of values. First element in the pair will be used for the title and the second will be used for the value.

$ds->set_values(
    [
        2008 => 22,
        2009 => 24,
        2010 => 25.5,
        2011 => 27.9,
        2012 => 31,
    ]
);

get_values

Returns the values or dies if there are no values.

TODO

Several move things should be done.

  • Check that color is one of yellow, green, red, purple, blue, mediumGray, pink, aqua, orange, or lightGray

  • Die if the title is not set

  • has_values()

AUTHOR

Ivan Bessarabov <ivan@bessarabov.ru>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Ivan Bessarabov.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.