diff options
Diffstat (limited to 'rt/html/RTx/Statistics/CallsMultiQueue/Elements/Chart')
-rwxr-xr-x | rt/html/RTx/Statistics/CallsMultiQueue/Elements/Chart | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/rt/html/RTx/Statistics/CallsMultiQueue/Elements/Chart b/rt/html/RTx/Statistics/CallsMultiQueue/Elements/Chart new file mode 100755 index 000000000..02a183b2c --- /dev/null +++ b/rt/html/RTx/Statistics/CallsMultiQueue/Elements/Chart @@ -0,0 +1,39 @@ +<%perl> +$r->content_type("image/$format"); +print $graph->plot(\@data)->$format(); +$m->abort(); +</%perl> +<em><&|/l, $#data+1&>[_1] Plot Elements</&></em><p> +% foreach my $value (@data) { +<% $value %><p> +% } +<em><&|/l&>x_labels</&>:</em><p> +<% $ARGS{x_labels} %> +<p> +<em><&|/l&>legend</&>:</em><p> +<% $ARGS{set_legend} %> +<p> +<em><&|/l, (keys %ARGS) - 2&>[_1] data sets</&>:</em><p> + +% for (1..(scalar keys %ARGS)-2) { +<% $_ %> <% $ARGS{"data$_"} %><p> +% } + +<%INIT> +use GD::Graph::lines; + +my @data; +my $graph = GD::Graph::lines->new($Statistics::GraphWidth,$Statistics::GraphHeight); +$graph->set(export_format => "png", + x_label => 'Day of Week', + y_label => 'Tickets per day'); +$graph->set_legend(split /,/ , $ARGS{set_legend}); +my $format = $graph->export_format; +push @data, [split /,/ , $ARGS{x_labels}]; +for (1..((scalar keys %ARGS)-2)) { + push @data, [split /,/ , $ARGS{"data".$_}]; +} + +</%INIT> +<%ARGS> +</%ARGS> |