[Jifty-commit] r5814 - in jifty/trunk: . lib/Jifty/Plugin/Chart/Renderer
Jifty commits
jifty-commit at lists.jifty.org
Mon Sep 8 16:41:26 EDT 2008
Author: sartak
Date: Mon Sep 8 16:41:26 2008
New Revision: 5814
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/XMLSWF.pm
jifty/trunk/lib/Jifty/Plugin/Chart/View.pm
Log:
r71148 at onn: sartak | 2008-09-08 16:41:03 -0400
Support for composite graphs in XML/SWF
Modified: jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/XMLSWF.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/XMLSWF.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/XMLSWF.pm Mon Sep 8 16:41:26 2008
@@ -65,7 +65,22 @@
);
# Make sure the type is ready to be used
- $args{type} = $types{ $args{type} } || undef;
+
+ if ($args{type} eq 'composite') {
+ for (@{ $args{types} }) {
+ if (!$types{$_}) {
+ Jifty->log->warn("Unsupported chart type: $_!");
+ return;
+ }
+ $_ = $types{$_};
+ }
+ }
+ else {
+ $args{type} = $types{ $args{type} } or do {
+ Jifty->log->warn("Unsupported chart type: $args{type}!");
+ return;
+ };
+ }
# Kill the "px" unit
$args{width} =~ s/px$//;
Modified: jifty/trunk/lib/Jifty/Plugin/Chart/View.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Chart/View.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Chart/View.pm Mon Sep 8 16:41:26 2008
@@ -112,6 +112,10 @@
},
);
+ if ($args->{type} eq 'composite') {
+ $chart{chart_type} = { string => $args->{types} };
+ }
+
for my $i ( 0 .. $#{ $args->{data} } ) {
push @{$chart{'chart_data'}{'row'}}, {
string => [ $args->{legend}[$i] || {} ],
More information about the Jifty-commit
mailing list