Page 1 of 1

Development estimate

Posted: Wed Jul 05, 2006 10:14 pm
by sanjay
Hi all,

I have a friend working for a state agency looking at environmental issues. They want to develop a site similar to:

http://www.climatecrisis.net/takeaction ... alculator/

But the energy usage is going to be actual rather than estimates. They will get get kwh and therms data from the users' utility companies and show progress over time.

1) User will log on (may need to be secure), will need a un & pw.
2) Populate forms to provide details needed for obtaining information from utilities.
3) The data will need to be shown in graphs.
4) Custom content displaying average for locality and for "friends" they have chosen.

I found that there are open source solutions for displaying graphs (php/mysql based), I assume a fair amount of work will be needed to integrate 1 of these to CMSMS.

There's money available to do this! or there will be, when we can show it can be done...

Any ideas and thoughts??

cheers
sanjay

Re: Development estimate

Posted: Wed Jul 05, 2006 10:21 pm
by Lahuindai
graphs are easy as the libraries exist and integrating it into cmsms is fairly easy, if you want i can whip one up somewhere for you too look at with example code ......

G

Re: Development estimate

Posted: Thu Jul 06, 2006 3:06 pm
by sanjay
Lahuindai wrote: graphs are easy as the libraries exist and integrating it into cmsms is fairly easy, if you want i can whip one up somewhere for you too look at with example code ......

G
That would be great. Thanks, I look forward to seeing that.

Re: Development estimate

Posted: Mon Jul 10, 2006 12:06 am
by Lahuindai
Hello Sanjay,

I'll try get to this tonight, been busy as hell the last week .....

Re: Development estimate

Posted: Thu Jul 13, 2006 9:59 pm
by Lahuindai
Sanjay, did you get the email ?

Maybe post the reply here so everybody can have a look, i would but i did not save a copy bfore sending it to you :)

G

Re: Development estimate

Posted: Fri Jul 14, 2006 6:57 pm
by sanjay
Thanks for the code Lahuindai. Here's your email below.

I'm ftp'ing JPgraph as I write. Although I think I'm going to need help on that.

I'll post the url if it works ...

Thanks again
Sanjay

---------

Hello Sanjay,

The library you wish to use (or at least it's the most complete from what i can see) is JpGraph
and is available from http://www.aditus.nu/jpgraph. Some example code below as i'm busy shifting to
new server and will only have place for example code in a week or so when they are stable.

Step 1:

Create a page in cmsms and add an image tag as follows:

Code: Select all

<img src='testgraph.php' width=300 height=200>
Step 2:

Create testgraph.php and add the following code

Code: Select all

<?php
  include_once ("jpgraph.php");   
  include_once ("jpgraph_line.php"); // Could be _bar etc depending on type of graph

  $graph_values = array(1,2,3,5,7,9,13,40,90,10);

  $graph = new Graph(300,200);
  $graph->SetScale("textlin");

  $plot = new LinePlot($graph_values);
  $graph->add($plot);
  $graph−>Stroke();
?>
and there you have it, nice and simple. Wrapping that up into cmsms should not be too difficult
depending on how complex the graphs are that you will need.

G