Chart::Composite Class Reference

Composite class derived from class Base. More...

Inheritance diagram for Chart::Composite:
Collaboration diagram for Chart::Composite:

Public Object Methods

int set (hash opts)
 Set all options.

Public Functions

 imagemap_dump ()
 Overwrite function imagemap_dump of base class.

Protected Functions

protected retval __print_array ()

Private Functions

private int _check_data
 Overwrite _check_data of Chart::Base and check the internal data to be displayed.
private _split_data
 split data to the composited classes
private _draw_data
 finally get around to plotting the data for composite chart
private _legend_example_height_values
 init the legend_example_height_values
private int _draw_legend ()
 let the user know what all the pretty colors mean
private int _draw_top_legend ()
 put the legend on the top of the data plot
private int _draw_right_legend ()
 put the legend on the right of the chart
private int _draw_left_legend ()
 draw the legend at the left of the data plot
private int _draw_bottom_legend ()
 put the legend on the bottom of the chart
private int _draw_none_legend ()
 no legend to draw.
private int _draw_ticks ()
 draw the ticks and tick labels
private int _draw_x_ticks ()
 draw the x-ticks and their labels
private int _draw_y_ticks ()
 draw the y-ticks and their labels
private _sub_update ()
 update all the necessary information in the sub-objects
private _boundary_update ()
 copy the current gd_obj boundaries from one object to another
private int _draw_y_grid_lines ()
 draw grid_lines for y
private int _draw_y2_grid_lines ()
 draw grid_lines for y

Additional Inherited Members

- Public Member Functions inherited from Chart::Base
object new ()
 Standard normal constructor.
Calls.
hash getopts ()
 get all options
int add_pt (list data)
 Graph API
Add one dataset (as a list) to the dataref.
 add_pt (\\\list data)
 Graph API
Add one dataset (as a reference to a list) to the dataref via.
int add_dataset (list data)
 Graph API
Add many datasets (implemented as a list) to the dataref,.
int add_dataset (\\\list data)
 Graph API
Add many datasets (implemented as a references to alist) to the dataref,.
int add_datafile (scalar filename, scalar format)
 Graph API
it's also possible to add a complete datafile
Uses.
int clear_data ()
 Clear Graph API (by undefining 'dataref'.
arrayref get_data ()
 Get array of data of the last graph.
int png (scalar file, scalar dataref)
 Produce the graph of options set in png format.
int cgi_png (scalar dataref)
 Produce the graph of options set in png format to be directly written for CGI.
int scalar_png (scalar dataref)
 Produce the graph of options set in PNG format to be directly returned.
int jpeg (scalar file, scalar dataref)
 Produce the graph of options set in JPG format to be directly plotted.
int cgi_jpeg (scalar dataref)
 Produce the graph of options set in JPG format to be directly for CGI.
int scalar_jpeg (scalar dataref)
 Produce the graph of options set in JPG format to be directly returned.
int make_gd (scalar dataref)
 Produce the graph of options set in GD format to be directly.
 minimum (list array)
 determine minimum of an array of values
 maximum (list array)
 determine maximum of an array of values
 arccos (scalar a)
 Function arccos(a)
 arcsin (scalar a)
 Function arcsin(a)
 true (scalar arg)
 determine true value of argument
 false (scalar arg)
 determine false value of argument
 modulo (scalar a, scalar b)
 Calculate float($a % $b) as the internal operator '' does only calculate in integers.
private int _init (scalar x, scalar y)
 Initialize all default options here.
private int _copy_data (scalar extern_ref)
 Copy external data via a reference to internal memory.
private array _color_spec_to_rgb (scalar role, scalar spec)
 Return an array (list of) rgb values for spec.
private int _draw_sub_title ()
 draw the sub-title for the chart
private int _sort_data ()
 sort the data nicely (mostly for the pareto charts and xy-plots)
private int _find_x_scale ()
 For a xy-plot do the same for the x values, as '_find_y_scale' does for the y values!
private int _find_y_scale ()
 find good values for the minimum and maximum y-value on the chart
private _calcTickInterval (scalar dataset_min, scalar dataset_max, scalar flag_fixed_min, scalar flag_fixed_max, scalar minTicks, scalar maxTicks)
 Calculate the Interval between ticks in y direction.
private int _calcXTickInterval (scalar min, scalar max, scalar minF, scalar maxF, scalar minTicks, scalar maxTicks)
 Calculate the Interval between ticks in x direction.
private int _countTicks (scalar min, scalar max, scalar interval)
 Works out how many ticks would be displayed at that interval.
private int _round2Tick (scalar input, scalar interval, scalar roundUP)
 Rounds up or down to the next tick of interval size.
private array _sepFP (scalar num)
 Seperates a number into it's base 10 floating point exponent & mantisa.
private array _find_y_range ()
 Find minimum and maximum value of y data sets.
private array _find_x_range ()
 Find minimum and maximum value of x data sets.
private int _plot ()
 main sub that controls all the plotting of the actual chart
private int _draw_x_label ()
 draw the label for the x-axis
private int _draw_y_label ()
 draw the label for the y-axis
private int _draw_x_number_ticks ()
 draw the ticks and tick labels
private int _grey_background ()
 put a grey background on the plot of the data itself
private int _draw_grid_lines ()
 draw grid_lines
private int _draw_x_grid_lines ()
 draw grid_lines for x
private int _prepare_brush (scalar color, scalar type, scalar role)
 prepare brush
- Public Attributes inherited from Chart::Base
Hash named_colors
 RGB values of named colors.
private int _check_data
 Check the internal data to be displayed.
private int _draw
 Plot the chart to the gd object
Calls:
private int _set_colors
 specify my colors
private int _color_role_to_index
 return a (list of) color index(es) corresponding to the (list of) role(s)
private int _brushStyles_of_roles
 return a (list of) brushStyles corresponding to the (list of) role(s)
private int _draw_title
 draw the title for the chart
private int _default_f_tick
 default tick conversion function This function is pointed to be $self->{f_x_tick} resp.
private float _xyRatio
 Get ratio width_x/width_y.
private float _xPixelInReal
 Get width of one Pixel in real coordinates in x-direction.
private float _yPixelInReal
 Get width of one Pixel in real coordinates in y-direction.

Detailed Description

Composite class derived from class Base.


This class provides all functions which are specific to composite charts

Member Function Documentation

private Chart::Composite::_boundary_update ( )

copy the current gd_obj boundaries from one object to another

Only for Chart::Composite

private int Chart::Composite::_draw_bottom_legend ( )

put the legend on the bottom of the chart

Overwrite the base class _draw_bottom_legend

Returns
status

Reimplemented from Chart::Base.

private int Chart::Composite::_draw_left_legend ( )

draw the legend at the left of the data plot

Overwrite the base class _draw_left_legend

Returns
status

Reimplemented from Chart::Base.

private int Chart::Composite::_draw_legend ( )

let the user know what all the pretty colors mean

Returns
status

Reimplemented from Chart::Base.

private int Chart::Composite::_draw_none_legend ( )

no legend to draw.

. just update the color tables for subs

This routine overwrites this function of the Base class

Returns
status

Reimplemented from Chart::Base.

private int Chart::Composite::_draw_right_legend ( )

put the legend on the right of the chart

Overwrite the base class _draw_right_legend

Returns
status

Reimplemented from Chart::Base.

private int Chart::Composite::_draw_ticks ( )

draw the ticks and tick labels

Overwrites function _draw_ticks() of base class

Returns
status

Reimplemented from Chart::Base.

private int Chart::Composite::_draw_top_legend ( )

put the legend on the top of the data plot

Overwrite the base class _draw_top_legend

Returns
status

Reimplemented from Chart::Base.

private int Chart::Composite::_draw_x_ticks ( )

draw the x-ticks and their labels

Overwrites function _draw_x_ticks() of base class

Returns
status

Reimplemented from Chart::Base.

private int Chart::Composite::_draw_y2_grid_lines ( )

draw grid_lines for y

Overwrites this function of Base

Reimplemented from Chart::Base.

private int Chart::Composite::_draw_y_grid_lines ( )

draw grid_lines for y

Overwrites this function of Base

Reimplemented from Chart::Base.

private int Chart::Composite::_draw_y_ticks ( )

draw the y-ticks and their labels

Overwrites function _draw_y_ticks() of base class

Returns
status

Reimplemented from Chart::Base.

private Chart::Composite::_sub_update ( )

update all the necessary information in the sub-objects

Only for Chart::Composite

Chart::Composite::imagemap_dump ( )

Overwrite function imagemap_dump of base class.

Get the information to turn the chart into an imagemap had to override it to reassemble the @data array correctly

Returns
Reference to an array of the image

Reimplemented from Chart::Base.

int Chart::Composite::set ( hash  opts)

Set all options.

Parameters
[in]%optsHash of options to the Chart
Returns
ok or croak

Overwrite the set function of class Base to pass options to the sub-objects later

Reimplemented from Chart::Base.

Member Data Documentation

private int Chart::Composite::_check_data

Overwrite _check_data of Chart::Base and check the internal data to be displayed.

Make sure the data isn't really weird and collect some basic info about it

Returns
status of check
private Chart::Composite::_legend_example_height_values

init the legend_example_height_values

private Chart::Composite::_split_data

split data to the composited classes

create sub-objects for each type, store the appropriate data sets in each one, and stick the correct values into them (ie. 'gd_obj');


The documentation for this class was generated from the following file: