| Chart-OFC2 documentation | Contained in the Chart-OFC2 distribution. |
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.
has '+type_name' => (default => 'hbar');
| Chart-OFC2 documentation | Contained in the Chart-OFC2 distribution. |
package Chart::OFC2::HBar;
use Moose; use MooseX::StrictConstructor; our $VERSION = '0.07'; extends 'Chart::OFC2::BarLineBase'; use Chart::OFC2::HBarValues;
has '+type_name' => (default => 'hbar'); has 'values' => (is => 'rw', isa => 'Chart::OFC2::HBarValues', 'coerce' => 1,); 1;