Chart::OFC2::HBar - OFC2 horizontal bar chart
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();
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.
y_axis-
has '+type_name' => (default => 'hbar');
To install Chart::OFC2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Chart::OFC2
CPAN shell
perl -MCPAN -e shell install Chart::OFC2
For more information on module installation, please visit the detailed CPAN module installation guide.