NAME

Chart::Plotly::Trace::Bar

VERSION

version 0.013

SYNOPSIS

use Chart::Plotly;
use Chart::Plotly::Trace::Bar;
use Chart::Plotly::Plot;
my $x = [ "apples", "bananas", "cherries" ];
my $sample1 = Chart::Plotly::Trace::Bar->new( x    => $x,
                                              y    => [ map { int( rand() * 10 ) } ( 1 .. ( scalar(@$x) ) ) ],
                                              name => "sample1"
);
my $sample2 = Chart::Plotly::Trace::Bar->new( x    => $x,
                                              y    => [ map { int( rand() * 10 ) } ( 1 .. ( scalar(@$x) ) ) ],
                                              name => "sample2"
);
my $sample3 = Chart::Plotly::Trace::Bar->new( x    => $x,
                                              y    => [ map { int( rand() * 10 ) } ( 1 .. ( scalar(@$x) ) ) ],
                                              name => "sample3"
);
my $plot = Chart::Plotly::Plot->new( traces => [ $sample1, $sample2, $sample3 ], layout => { barmode => 'group' } );
Chart::Plotly::show_plot($plot);

DESCRIPTION

This file has been autogenerated from the official plotly.js source.

If you like Plotly, please support them: https://plot.ly/ Open source announcement: https://plot.ly/javascript/open-source-announcement/

Full reference: https://plot.ly/javascript/reference/#bar

NAME

Chart::Plotly::Trace::Bar

DISCLAIMER

This is an unofficial Plotly Perl module. Currently I'm not affiliated in any way with Plotly. But I think plotly.js is a great library and I want to use it with perl.

METHODS

TO_JSON

Serialize the trace to JSON. This method should be called only by JSON serializer.

ATTRIBUTES

  • base

    Sets where the bar base is drawn (in position axis units). In *stack* or *relative* barmode, traces that set *base* will be excluded and drawn in *overlay* mode instead.

  • dx

    Sets the x coordinate step. See `x0` for more info.

  • dy

    Sets the y coordinate step. See `y0` for more info.

  • error_x

  • error_y

  • insidetextfont

    Sets the font used for `text` lying inside the bar.

  • marker

  • offset

    Shifts the position where the bar is drawn (in position axis units). In *group* barmode, traces that set *offset* will be excluded and drawn in *overlay* mode instead.

  • orientation

    Sets the orientation of the bars. With *v* (*h*), the value of the each bar spans along the vertical (horizontal).

  • outsidetextfont

    Sets the font used for `text` lying outside the bar.

  • r

    For polar chart only.Sets the radial coordinates.

  • t

    For polar chart only.Sets the angular coordinates.

  • text

    Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates.

  • textfont

    Sets the font used for `text`.

  • textposition

    Specifies the location of the `text`. *inside* positions `text` inside, next to the bar end (rotated and scaled if needed). *outside* positions `text` outside, next to the bar end (scaled if needed). *auto* positions `text` inside or outside so that `text` size is maximized.

  • width

    Sets the bar width (in position axis units).

  • x

    Sets the x coordinates.

  • x0

    Alternate to `x`. Builds a linear space of x coordinates. Use with `dx` where `x0` is the starting coordinate and `dx` the step.

  • y

    Sets the y coordinates.

  • y0

    Alternate to `y`. Builds a linear space of y coordinates. Use with `dy` where `y0` is the starting coordinate and `dy` the step.

  • name

    Sets the trace name

type

Trace type.

AUTHOR

Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>

COPYRIGHT AND LICENSE

Copyright (c) 2017 by Pablo Rodríguez González.

This is free software, licensed under:

The MIT (X11) License