fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-04-28 04:46 am

[dw-free] Tweak bar graphs generated by DW::Graphs

[commit: http://hg.dwscoalition.org/dw-free/rev/6fe3db4ec3e5]

http://bugs.dwscoalition.org/show_bug.cgi?id=2951

Make graphs on dreamwidth.org/stats/site work with the new DW::Graphse 2

Patch by [personal profile] anarres.

Files modified:
  • cgi-bin/DW/Controller/Graphs.pm
  • etc/sitestats_graphs.yaml
--------------------------------------------------------------------------------
diff -r cae9d7ed7ee7 -r 6fe3db4ec3e5 cgi-bin/DW/Controller/Graphs.pm
--- a/cgi-bin/DW/Controller/Graphs.pm	Thu Apr 28 12:43:50 2011 +0800
+++ b/cgi-bin/DW/Controller/Graphs.pm	Thu Apr 28 12:45:31 2011 +0800
@@ -30,6 +30,8 @@ DW::Controller::Graphs - Controller modu
     use DW::Controller::Graphs;
 
 =cut
+
+package DW::Controller::Graphs;
 
 package DW::Controller::Graphs;
 
@@ -129,7 +131,7 @@ sub active_community_accounts {
     my $input = [ [@labels], [@free_dataset], [@paid_dataset] ];
 
     # create an image (x and y labels not wanted so pass empty strings)
-    my $gd = DW::Graphs::bar2($input, '', '', $names);
+    my $gd = DW::Graphs::bar2( $input, '', '', $names, "sitestats_graphs.yaml" );
 
     # return the image
     $r->content_type("image/png");
@@ -175,7 +177,7 @@ sub active_identity_accounts {
     my $input = [ [@labels], [@free_dataset], [@paid_dataset] ];
 
     # create an image (x and y labels not wanted so pass empty strings)
-    my $gd = DW::Graphs::bar2($input, '', '', $names);
+    my $gd = DW::Graphs::bar2( $input, '', '', $names, "sitestats_graphs.yaml" );
 
     # return the image
     $r->content_type("image/png");
@@ -221,7 +223,7 @@ sub active_personal_accounts {
     my $input = [ [@labels], [@free_dataset], [@paid_dataset] ];
 
     # create an image (x and y labels not wanted so pass empty strings)
-    my $gd = DW::Graphs::bar2($input, '', '', $names);
+    my $gd = DW::Graphs::bar2( $input, '', '', $names, "sitestats_graphs.yaml" );
 
     # return the image
     $r->content_type("image/png");
diff -r cae9d7ed7ee7 -r 6fe3db4ec3e5 etc/sitestats_graphs.yaml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/sitestats_graphs.yaml	Thu Apr 28 12:45:31 2011 +0800
@@ -0,0 +1,14 @@
+---
+# etc/sitestats_graphs.yaml
+#
+# Actual configuration file for DW::Graphs
+#
+# Authors:
+#      Anarres <anarres@dreamwidth.org>
+#
+# Copyright (c) 2010-2011 by Dreamwidth Studios, LLC.
+#
+# This program is free software; you may redistribute it and/or modify it under
+# the same terms as Perl itself.  For a copy of the license, please reference
+# 'perldoc perlartistic' or 'perldoc perlgpl'.
+bar_spacing: 50
--------------------------------------------------------------------------------