View Single Post
  #3 (permalink)  
Old 08-20-03, 07:53 AM
Squeezer's Avatar
Squeezer Squeezer is offline
Newbie Coder
 
Join Date: Jun 2003
Location: Luxembourg
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Hello

well this isn't the entire code but only the code to generate the graph!
the queries to the database tables were removed!
but the queries return the following values
$datavalues --> The evaluation values of the chart

The fake values (i add) is an array containing values that are continously 0! This array is also a line plot but not in the visible scope of the graph! I use this trick to prevent the graph from autoscaling horizontaly (if i wouldn't do this the graph would be spread over the entire width, even if there were only some values)

PHP Code:

<?php

$graph
->SetScale("textlin"$intra_down$intra_top);
$graph->SetFrame(true"$bgcolor");
$graph->SetMargin(27550);

$graph->SetMarginColor("$bgcolor");
$graph->SetColor("$bgcolor");

$graph->yaxis->HideZeroLabel();
$graph->yaxis->SetColor("$axiscolor");
$graph->yaxis->SetLabelmargin(2);
$graph->yaxis->scale->SetAutoMin($intra_down);
$graph->yaxis->scale->SetAutoMax($intra_top);
$graph->yaxis->HideTicks(true);

$graph->xaxis->SetColor("$axiscolor");

$graph->xaxis->SetTextTickInterval($interval);
$graph->xaxis->SetLabelmargin(1);
// grid config
$graph->xgrid->SetColor("$gridcolor");
$graph->ygrid->SetColor("$gridcolor");
$graph->xgrid->Show();
$graph->ygrid->Show();
// Create the first line
if ($drawfake == "true") {
    
// create the second line plot
    
$p2 = new LinePlot($fakearray);
    
$graph->Add($p2);


$p1 = new LinePlot($datavalues);
$p1->SetColor("$globalcolor");
// $p1->SetFillColor("$fillupcolor");
$p1->SetStyle('solid');
$p1->SetWeight(1);

$graph->Add($p1);

$graph->Stroke();
?>
__________________
Marc Giombetti - PHP Programmer
marc@giombetti.com
http://www.giombetti.com
Luxembourg - Europe

Last edited by Squeezer; 08-21-03 at 09:50 AM.
Reply With Quote