// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_line.php';
require_once 'jpgraph/jpgraph_log.php';
// Matrix size rxr
$r = 10;
// Max Interpolation factor
$f = 5;
for ($i = 1; $i <= $f; ++$i) {
    $xdata[] = $i;
    $ydata[] = pow($r * pow(2, $i - 1) - (pow(2, $i) - 1), 2);
}
$graph = new Graph\Graph(400, 240);
$graph->SetScale('intlog');
$graph->SetMargin(50, 50, 20, 30);
$graph->SetFrame(false);
$graph->SetBox(true, 'black', 2);
$graph->SetMarginColor('white');
$graph->SetColor('lightyellow@0.7');
$graph->title->Set('Interpolation growth for size 10x10');
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->SetTitle('Interpolation factor', 'center');
$graph->xaxis->SetTitleMargin(10);
$graph->SetAxisStyle(AXSTYLE_YBOXIN);
$graph->xgrid->Show();
$lp1 = new Plot\LinePlot($ydata, $xdata);
$lp1->SetColor('darkred');
$lp1->SetWeight(3);
$graph->Add($lp1);
$graph->Stroke();
Пример #2
0
<?php

require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_bar.php';
$data1y = array(47, 80, 40, 116);
$graph = new Graph\Graph(400, 300, 'auto');
$graph->SetScale('textlin');
$theme_class = new AquaTheme();
$graph->SetTheme($theme_class);
// after setting theme, you can change details as you want
$graph->SetFrame(true, 'lightgray');
// set frame visible
$graph->xaxis->SetTickLabels(array('A', 'B', 'C', 'D'));
// change xaxis lagels
$graph->title->Set("Theme Example");
// add title
// add barplot
$bplot = new Plot\BarPlot($data1y);
$graph->Add($bplot);
// you can change properties of the plot only after calling Add()
$bplot->SetWeight(0);
$bplot->SetFillGradient('#FFAAAA:0.7', '#FFAAAA:1.2', GRAD_VER);
$graph->Stroke();
Пример #3
0
<?php

// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_line.php';
$datay1 = array(4, 26, 12, 18, 8, 22);
$datay2 = array(12, 9, 42, 8, 20, 19);
// Setup the graph
$graph = new Graph\Graph(300, 200);
$graph->SetMarginColor('white');
$graph->SetScale("textlin", 0, 50);
$graph->SetMargin(30, 50, 30, 30);
// We must have the frame enabled to get the gradient
// However, we don't want the frame line so we set it to
// white color which makes it invisible.
$graph->SetFrame(true, 'white');
// Setup a background gradient image
$graph->SetBackgroundGradient('blue', 'navy:0.5', GRAD_HOR, BGRAD_PLOT);
// Setup the tab title
$graph->tabtitle->Set(' 3rd Division ');
$graph->tabtitle->SetFont(FF_ARIAL, FS_BOLD, 13);
// Setup x,Y grid
$graph->xgrid->Show();
$graph->xgrid->SetColor('gray@0.5');
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
$graph->ygrid->SetColor('gray@0.5');
// Setup color for axis and labels on axis
$graph->xaxis->SetColor('orange', 'black');
$graph->yaxis->SetColor('orange', 'black');
// Ticks on the outsid
$graph->xaxis->SetTickSide(SIDE_DOWN);
Пример #4
0
$graph2->yaxis->SetColor('red');
$graph2->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 9);
$graph2->yaxis->SetLabelMargin(0);
$graph2->yaxis->scale->SetAutoMin(0);
$line2 = new Plot\LinePlot($data_windspeed, $xdata);
$line2->SetStepStyle();
$line2->SetColor('red');
$graph2->Add($line2);
//------------------------------------------------------------------
// Setup the wind temp graph
//------------------------------------------------------------------
$graph3 = new Graph\Graph(WIND_WIDTH - 30, WIND_HEIGHT);
$graph3->SetScale('datlin');
$graph3->Set90AndMargin(5, 20, 70, 30);
$graph3->SetMarginColor(BKG_COLOR);
$graph3->SetFrame(true, 'white', 0);
$graph3->SetBox();
$graph3->title->Set('Temperature');
$graph3->title->SetColor('black');
$graph3->title->SetFont(FF_ARIAL, FS_BOLD, 14);
$graph3->title->SetMargin(5);
$graph3->xaxis->HideLabels();
$graph3->xgrid->Show();
$graph3->yaxis->SetLabelAngle(90);
$graph3->yaxis->SetColor('black');
$graph3->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 9);
$graph3->yaxis->SetLabelMargin(0);
$graph3->yaxis->scale->SetAutoMin(-10);
$line3 = new Plot\LinePlot($data_windtemp, $xdata);
$line3->SetStepStyle();
$line3->SetColor('black');