From: Dobrica Pavlinusic Date: Sat, 13 Jun 2009 16:12:23 +0000 (+0000) Subject: small Protovis example X-Git-Url: http://git.rot13.org/?p=webpac2;a=commitdiff_plain;h=7478a4b374e277820841d39485d7c5af97a35395 small Protovis example git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1229 07558da8-63fa-0310-ba24-9fe276d99e06 --- diff --git a/vhost/dipl/data.cgi b/vhost/dipl/data.cgi new file mode 100755 index 0000000..c7e3c70 --- /dev/null +++ b/vhost/dipl/data.cgi @@ -0,0 +1,19 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +use JSON; +use DBI; + +print "Content-type: text/javascript\n\r\n\r"; + +my $dbh = DBI->connect('dbi:Pg:dbname=dipl','dpavlin','', { RaiseError => 1, AutoCommit => 0 }); + +my $data = $dbh->selectall_arrayref(q{ + select sum(ttc),ca from citirani group by ca order by sum desc ; +}); +print "var data = ",to_json( +# [ map { $_->[0] } @$data ] + $data +),";\n\r"; diff --git a/vhost/dipl/pie.html b/vhost/dipl/pie.html new file mode 100644 index 0000000..ca3d32c --- /dev/null +++ b/vhost/dipl/pie.html @@ -0,0 +1,59 @@ + + + citirani pie + + + + + + +Protovis + + + + +