John Goulah > Chart-OFC2-0.05 > Chart::OFC2::HBar

Download:
Chart-OFC2-0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.05   Source   Latest Release: Chart-OFC2-0.08_02

NAME ^

Chart::OFC2::HBar - OFC2 horizontal bar chart

SYNOPSIS ^

    my $chart = Chart::OFC2->new(
        'title'  => 'HBar chart test',
        'y_axis' => Chart::OFC2::YAxis->new(
            'labels' => [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun' ],
            'offset' => 1,
        ),
        'tooltip' => {
            'mouse' => 2,
        },
    );
    
    my $hbar = Chart::OFC2::HBar->new(
        'values' => [ { 'left' => 1.5, 'right' => 3, }, 1, 2, 3, 4, 5, ],
        'colour' => '#40FF0D',
    );

    print $chart->render_chart_data();

DESCRIPTION ^

        extends 'Chart::OFC2::BarLineBase';

In Chart::OFC2::HBarValues when converting values to JSON the values are reversed. This is done so that the y_axis-labels> match to the values. Also note that the y_axis-offset> is set to one so that the label is in the middle of the bar.

PROPERTIES ^

        has '+type_name' => (default => 'hbar');
syntax highlighting: