Apache-Wyrd

 view release on metacpan or  search on metacpan

Wyrd/Chart.pm  view on Meta::CPAN

hbars, bars, points, linespoints, area, or pie

=item b_margin t_margin l_margin r_margin

edge-to-graphic margins

=item transparent interlaced

PNG options

=item bgclr fgclr boxclr textclr labelclr axislabelclr legendclr valuesclr
accentclr shadowclr

Colors for the respective chart elements

=item dclrs borderclrs

Data element and border colors, in list format.

=item show_values values_vertical values_space values_format

Whether (1=yes) to show values, whether vertically, what space (pixels)
around them and what (sprintf-style) format to display them in.

=item logo logo_position logo_resize

logo file, corner for logo, and resize factor

=item legend_placement legend_spacing legend_marker_width
legend_marker_height lg_cols

Legend attributes (axestype graphs only)

=item x_label y_label box_axis two_axes zero_axis zero_axis_only
x_plot_values y_plot_values y_max_value y_min_value x_tick_number
x_min_value x_tick_number x_min_value x_max_value y_number_format
x_label_skip y_label_skip x_tick_offset x_all_ticks x_label_position
y_label_position x_labels_vertical long_ticks tick_length x_ticks
y_tick_number axis_space text_space

Wyrd/Chart.pm  view on Meta::CPAN


Marker types (1: filled square, 2: open square, 3: horizontal cross, 4:
diagonal cross, 5: filled diamond, 6: open diamond, 7: filled circle, 8:
open circle, 9: horizontal line, 10: vertical line) and size (in pixels)

=item 3d pie_height start_angle suppress_angle

Pie chart attributes.  suppress_angle is a limit below which no line is
drawn

=item legend_font title_font x_label_font y_label_font x_axis_font
y_axis_font

Fonts.  Either a file (if your system supports TTF) or one of the builtin
fonts: gdTinyFont gdSmallFont gdMediumBoldFont gdLargeFont gdGiantFont

=back

=back

=head2 PERL METHODS

Wyrd/Chart.pm  view on Meta::CPAN

		next unless defined ($self->{$attrib});
		my ($font, $size) = token_parse($self->{$attrib});
		my $approved_font = $self->_ok_font($font);
		if ($approved_font) {
			eval "\$graph->set_$attrib('$approved_font', $size)";
			$self->_error("Could not use font $font in attribute $attrib: $@") if ($@);
		} else {
			$self->_error("Could not use font $font in attribute $attrib");
		}
	}
	$graph->set_legend(token_parse($self->{'legend'})) if $self->{'legend'};

	my %settings = ();
	foreach my $attribute (@{$self->{'_chart_attributes'}}) {
		$settings{$attribute} = $self->{$attribute} if defined($self->{$attribute});
	}

	#warn Dumper(\%settings);
	$graph->set(%settings);
	return $graph;
}

Wyrd/Chart.pm  view on Meta::CPAN

Produces, by default, a second file (E<lt>graphic_nameE<gt>.tdf) in the same
directory as the graphic which has the HTML fingerprint and the data stored
in tab-delineated-text format.

=cut

sub _setup {
	my ($self) = @_;
	$self->{'_valid_attributes'} = {
		'img'			=>	[qw(align alt border height hspace ismap longdesc usemap vspace width src)],
		'all'			=>	[qw(b_margin t_margin l_margin r_margin transparent interlaced bgclr fgclr boxclr textclr labelclr axislabelclr legendclr valuesclr accentclr shadowclr dclrs show_values values_vertical values_space values_format logo logo_position logo_...
		'axes'			=>	[qw(x_label y_label box_axis two_axes zero_axis zero_axis_only x_plot_values y_plot_values y_max_value y_min_value x_tick_number x_min_value x_tick_number x_min_value x_max_value y_number_format x_label_skip y_label_skip x_tick_offset x...
		'bars'			=>	[qw(overwrite bar_width bar_spacing shadow_depth borderclrs cycle_clrs cumulate)],
		'lines'			=>	[qw(line_types line_type_scale line_width skip_undef)],
		'points'		=>	[qw(markers marker_size)],
		'pie'			=>	[qw(3d pie_height start_angle suppress_angle)],
		'builtin_fonts'	=>	[qw(gdTinyFont gdSmallFont gdMediumBoldFont gdLargeFont gdGiantFont)],
		'font_attr'		=>	[qw(legend_font title_font x_label_font y_label_font x_axis_font y_axis_font)],
		'font_attr_pie'	=>	[qw(legend_font title_font label_font value_font)],
		'color_attr'	=>	[qw(bgclr fgclr boxclr textclr labelclr axislabelclr legendclr valuesclr accentclr shadowclr dclrs)],
		'array_attr'	=>	[qw(dclrs markers)],
		'boolean_attr'	=>	[qw(transparent interlaced show_values values_vertical box_axis two_axes zero_axis zero_axis_only x_plot_values y_plot_values x_all_ticks x_labels_vertical long_ticks x_ticks correct_width cycle_clrs cumulate skip_undef 3d)]
	};
	$self->{'_chart_attributes'} = [];
	$self->_set_default_attributes;
}

sub _format_output {
	my ($self) = @_;
	$self->_raise_exception('Chart Wyrds require Query Wyrds')



( run in 1.168 second using v1.01-cache-2.11-cpan-49f99fa48dc )