require_once '../lib/BackgroundStyle.php'; require_once '../lib/pCache.php'; // Definitions $DataSet = new pData(); $Canvas = new GDCanvas(700, 230); $Chart = new pChart(700, 230, $Canvas); // Dataset $DataSet->AddPoints(array(1, 4, 3, 2, 3, 3, 2, 1, 0, 7, 4, 3, 2, 3, 3, 5, 1, 0, 7), "Serie1"); $DataSet->AddPoints(array(1, 4, 2, 6, 2, 3, 0, 1, 5, 1, 2, 4, 5, 2, 1, 0, 6, 4, 2), "Serie2"); $DataSet->AddAllSeries(); $DataSet->SetAbscissaLabelSeries(); $DataSet->SetSeriesName("January", "Serie1"); $DataSet->SetSeriesName("February", "Serie2"); // Cache definition $Cache = new pCache(); $Cache->GetFromCache("Example11", $DataSet->GetData()); // Initialise the graph $Chart->setFontProperties("../Fonts/tahoma.ttf", 8); $Chart->setGraphArea(50, 30, 585, 200); $Chart->drawScale($DataSet, ScaleStyle::DefaultStyle(), 0, 2); $Chart->drawGrid(new GridStyle(4, TRUE, new Color(230), 50)); // Draw the 0 line $Chart->setFontProperties("../Fonts/tahoma.ttf", 6); $Chart->drawTreshold(0, new Color(143, 55, 72), TRUE, TRUE); // Draw the cubic curve graph $Chart->drawCubicCurve($DataSet, 0.1, "Serie1"); $Chart->drawCubicCurve($DataSet, 0.1, "Serie2"); // Finish the graph $Chart->setFontProperties("../Fonts/tahoma.ttf", 8); $Chart->drawLegend(600, 30, $DataSet->GetDataDescription(), new Color(255)); $Chart->setFontProperties("../Fonts/tahoma.ttf", 10);
*/ // Standard inclusions include "pChart/pData.class"; include "pChart/pChart.class"; include "pChart/pCache.class"; // Dataset definition $DataSet = new pData(); $DataSet->AddPoint(array(1, 4, 3, 2, 3, 3, 2, 1, 0, 7, 4, 3, 2, 3, 3, 5, 1, 0, 7), "Serie1"); $DataSet->AddPoint(array(1, 4, 2, 6, 2, 3, 0, 1, 5, 1, 2, 4, 5, 2, 1, 0, 6, 4, 2), "Serie2"); $DataSet->AddAllSeries(); $DataSet->SetAbsciseLabelSerie(); $DataSet->SetSerieName("January", "Serie1"); $DataSet->SetSerieName("February", "Serie2"); // Cache definition $Cache = new pCache(); $Cache->GetFromCache("Graph1", $DataSet->GetData()); // Initialise the graph $Test = new pChart(700, 230); $Test->setFontProperties("Fonts/tahoma.ttf", 8); $Test->setGraphArea(50, 30, 585, 200); $Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); $Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); $Test->drawGraphArea(255, 255, 255, TRUE); $Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), 5, 150, 150, 150, TRUE, 0, 2); $Test->drawGrid(4, TRUE, 230, 230, 230, 50); // Draw the 0 line $Test->setFontProperties("Fonts/tahoma.ttf", 6); $Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); // Draw the cubic curve graph $Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription()); // Finish the graph
$FileName = './tmp/' . md5($user['name']) . ".png"; // Graph $DataSet = new pData(); $DataSet->AddPoint($points, "points"); $DataSet->AddPoint($rank, "rank"); $DataSet->AddPoint($time, "time"); $DataSet->AddSerie("points"); $DataSet->SetAbsciseLabelSerie(); $DataSet->SetSerieName("Punkte", "points"); $DataSet->SetSerieName("Rank", "rank"); $DataSet->SetYAxisName("Punkte"); $DataSet->SetAbsciseLabelSerie("time"); //$DataSet->SetXAxisFormat("date"); // Cache definition $Cache = new pCache('../charts/Cache/'); if ($use_cache && !$Cache->GetFromCache(md5($user['name']), $DataSet->GetData(), $FileName) or !$use_cache) { // Initialise the graph $Test = new pChart(715, 230); $Test->setDateFormat('d.m H:i'); $Test->setFontProperties("../charts/Fonts/tahoma.ttf", 8); $Test->setGraphArea(60, 30, 650, 150); $Test->drawFilledRoundedRectangle(7, 7, 708, 223, 5, 240, 240, 240); $Test->drawRoundedRectangle(5, 5, 710, 225, 5, 163, 203, 167); $Test->drawGraphArea(255, 255, 255, TRUE); $Test->drawGraphAreaGradient(163, 203, 167, 50); $Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_DIFF, 150, 150, 150, TRUE, 75, 0, FALSE, $skip_scale); $Test->drawGrid(4, TRUE, 230, 230, 230, 40); // Draw the graph $Test->drawFilledCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription(), 0.1, 30); if ($scale_hours <= 48) { $Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 2, 1, 255, 255, 255);