From 7478a4b374e277820841d39485d7c5af97a35395 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 13 Jun 2009 16:12:23 +0000 Subject: [PATCH] small Protovis example git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1229 07558da8-63fa-0310-ba24-9fe276d99e06 --- vhost/dipl/data.cgi | 19 +++++++++++++++ vhost/dipl/pie.html | 59 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100755 vhost/dipl/data.cgi create mode 100644 vhost/dipl/pie.html 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 + + + + + -- 2.20.1