Jump to content

The slightly more advanced. self-generating frame


kimjessen

Recommended Posts

hey now I have to put the pieces together. 

The project consists in the analysis of weather and solar radiation. 

I have a solar power plant on my roof and I would do some analysis on it.

and while it get a little experience with php.


so now I have found out to buffer data to my serwer. 

I have also found out how to make a graph. 

I have also found out how I'll get it right CSV file from the server. 

super! 

 

Now I would like to analyze it. 

 

is it possible to have PHP. to construct multiple frames. 

Understood in this way that when the first graph is made ther is automatically made ​​a new frame with the next day's graph ETC. 

 

it is possible


 

any suggestions.

I use JPgraph to the graph part

it will depend on how many files are in the library. 

I count them and put in as a variable. 

but it is typically 30-31 days. 

but you write it as if it is no problem? 

will the graphs come below each other or there will be 30 new pages.?

hi I've tried to fiddle with this for () loop. 
but it does not work. 

 

I have attached here a simple example of the graph how will you print that FX. 3 times, below each other.
<?php // content="text/plain; charset=utf-8"
require_once('jpgraph/src/jpgraph.php');
	require_once('jpgraph/src/jpgraph_line.php');

$datay1 = array(20,15,23,15);

// Setup the graph
$graph = new Graph(300,250);
$graph->SetScale("textlin");

$theme_class=new UniversalTheme;

$graph->SetTheme($theme_class);
$graph->img->SetAntiAliasing(false);
$graph->title->Set('Filled Y-grid');
$graph->SetBox(false);

$graph->img->SetAntiAliasing();

$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);

$graph->xgrid->Show();
$graph->xgrid->SetLineStyle("solid");
$graph->xaxis->SetTickLabels(array('A','B','C','D'));
$graph->xgrid->SetColor('#E3E3E3');

// Create the first line
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p1->SetColor("#6495ED");
$p1->SetLegend('Line 1');

$graph->legend->SetFrameWeight(1);

// Output line
$graph->Stroke();

?>

hmmm have worked a lot with it now. 

and read about jpgraph, I think the right way is to generate 30 image files and then load them up on a html page afterwards. 

 

to just work some more with this solution, but I think that I would be able to get to work.

 

what do you say, is it the right solution?

I think that's what Ch0cu3r suggested... You'll have to generate an image 30 times and include those 30 images in an HTML pages. I don't know why you talked about 'frames' in your first post, but using frame here doesn't make sense (if you talk about HTML frames or iframes).

 

Here's what you'll need to do (that's pseudo-code, meaning that it doesn't really work, it's just to show you the logic):

// Generates an image with the $data passed as the first parameter
// returns the image path that we created
function generateGraph($data)
  // generate an image with the $data
  // return the path of the image
  return $imagePath  

// Loop trough all image data
// Create images one by one
// Display the image
for ($i: 0 to $numberOfImages) 
  $imagePath = generateGraph($dataImage[$i]);
 echo <img src="$imagePath">

I hope it helps! :)

hi yes it is a bit the same conclusion I came to. 

Sorry I still mess around with what the different things ar called .

 

I believe what I mean is called tables.

 


well no matter 

I have some things I have to try out, I will return

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.