Chart-Clicker

 view release on metacpan or  search on metacpan

README.mkdn  view on Meta::CPAN

    $cc->title->font->size(20);
    # etc, etc

If the title has text then it is added to the chart in the position specified
by `title_position`.

You should consult the documentation for [Graphics::Primitive::TextBox](https://metacpan.org/pod/Graphics::Primitive::TextBox) for
things like padding and text rotation.  If you are adding it to the top and
want some padding between it and the plot, you can:

    $cc->title->padding->bottom(5);

## title\_position

The position the title will be added.  Should be one of north, south, east,
west or center as required by [Layout::Manager::Compass](https://metacpan.org/pod/Layout::Manager::Compass).

Note that if no angle is set for the title then it will be changed to
\-1.5707 if the title position is east or west.

## width

Set/Get the width.  Defaults to 500.

# METHODS

## context\_count

Get a count of contexts.

## context\_names

Get a list of context names.

## delete\_context ($name)

Remove the context with the specified name.

## get\_context ($name)

Get the context with the specified name

## set\_context ($name, $context)

Set a context of the specified name.

## add\_to\_datasets

Add the specified dataset (or arrayref of datasets) to the chart.

## dataset\_count

Get a count of datasets.

## get\_dataset ($index)

Get the dataset at the specified index.

## rendered\_data

Returns the data for this chart as a scalar.  Suitable for 'streaming' to a
client.

## add\_to\_over\_decorations

Add an over decoration to the list.

## get\_over\_decoration ($index)

Get the over decoration at the specified index.

## over\_decoration\_count

Get a count of over decorations.

## add\_to\_contexts

Add the specified context to the chart.

## add\_subgraph

Add a subgraph to this chart.

## draw

Draw this chart.

## get\_datasets\_for\_context

Returns an arrayref containing all datasets for the given context.  Used by
renderers to get a list of datasets to chart.

## add\_data ($name, $data)

Convenience method for adding data to the chart.  Can be called one of three
ways.

- **scalar**

    Passing a name and a scalar will append the scalar data to that series' data.

        $cc->add_data('Sales', 1234);
        $cc->add_data('Sales', 1235);

    This will result in a Series named 'Sales' with two values.

- **arrayref**

    Passing a name and an arrayref works much the same as the scalar method
    discussed above, but appends the supplied arrayref to the existing one.  It
    may be mixed with the scalar method.

        $cc->add_data('Sales', \@some_sales);
        $cc->add_data('Sales', \@some_more_sales);
        # This works still!
        $cc->add_data('Sales', 1234);

- **hashref**

    This allows you to pass both keys and values in all at once.



( run in 1.771 second using v1.01-cache-2.11-cpan-140bd7fdf52 )