Example #1
0
     $Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 2, 1, 255, 255, 255);
 }
 // Draw labels
 if (!empty($ccities)) {
     foreach ($ccities as $k => $v) {
         $Test->setLabel($DataSet->GetData(), $DataSet->GetDataDescription(), "points", $k, "St├Ądte: {$v}", 239, 233, 195);
     }
 }
 $Test->clearShadow();
 // Clear the scale
 $Test->clearScale();
 // Draw the 2nd graph
 $DataSet->RemoveSerie("points");
 $DataSet->AddSerie("rank");
 $DataSet->SetYAxisName("Rank");
 $Test->drawRightScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_DIFF, 150, 150, 150, TRUE, 75, 0, FALSE, $skip_scale, TRUE);
 // Draw the 0 line
 $Test->setFontProperties("../charts/Fonts/tahoma.ttf", 6);
 $Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
 // Draw the Line graph
 $Test->drawFilledCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription(), 0.1, 20);
 if ($scale_hours <= 48) {
     $Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 2, 1, 255, 255, 255);
 }
 // Draw Labels
 $Test->setFontProperties("../charts/Fonts/tahoma.ttf", 8);
 if (!empty($ally)) {
     foreach ($ally as $k => $v) {
         if ($v != 0) {
             $_alliance = $redis->HGETALL("alliance:{$v}:data");
             $Test->setLabel($DataSet->GetData(), $DataSet->GetDataDescription(), "rank", $k, "Ally: {$_alliance['name']}", 221, 230, 174);
    $Chart->setFontProperties(IMAGE_PATH . '/sig/font/DejaVuSans.ttf', 11);
    $Chart->drawTextBox(100, 90, 180, 110, "Not Enough Session Data", 0, 0, 0, 0, ALIGN_LEFT, FALSE, 255, 255, 255, 0);
} else {
    $DataSet = new pData();
    $DataSet->AddPoint($skill, 'SerieSkill');
    $DataSet->AddPoint($skill_change, 'SerieSession');
    $DataSet->AddPoint($date, 'SerieDate');
    $DataSet->AddSerie('SerieSkill');
    $DataSet->SetAbsciseLabelSerie('SerieDate');
    $DataSet->SetSerieName('Skill', 'SerieSkill');
    $DataSet->SetSerieName('Session', 'SerieSession');
    $Chart->setFontProperties(IMAGE_PATH . '/sig/font/DejaVuSans.ttf', 7);
    $DataSet->SetYAxisName('Skill');
    $DataSet->SetYAxisUnit('K');
    $Chart->setColorPalette(0, 255, 255, 0);
    $Chart->drawRightScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, $color['red'], $color['green'], $color['blue'], TRUE, 0, 0);
    $Chart->drawGrid(1, FALSE, 55, 55, 55, 100);
    $Chart->setShadowProperties(3, 3, 0, 0, 0, 30, 4);
    $Chart->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription());
    $Chart->clearShadow();
    $Chart->drawFilledCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription(), 0.1, 30);
    $Chart->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 1, 1, 255, 255, 255);
    $Chart->clearScale();
    $DataSet->RemoveSerie('SerieSkill');
    $DataSet->AddSerie('SerieSession');
    $DataSet->SetYAxisName('Session');
    $DataSet->SetYAxisUnit('');
    $Chart->setColorPalette(1, 255, 0, 0);
    $Chart->setColorPalette(2, 0, 0, 255);
    $Chart->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, $color['red'], $color['green'], $color['blue'], TRUE, 0, 0);
    $Chart->setShadowProperties(3, 3, 0, 0, 0, 30, 4);
Example #3
0
$DataSet->SetYAxisName("Sourceforge Rank");
$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 213, 217, 221, TRUE, 0, 0);
$Test->drawGraphAreaGradient(40, 40, 40, -50);
$Test->drawGrid(4, TRUE, 230, 230, 230, 10);
$Test->setShadowProperties(3, 3, 0, 0, 0, 30, 4);
$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription());
$Test->clearShadow();
$Test->drawFilledCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription(), 0.1, 30);
$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255);
// Clear the scale
$Test->clearScale();
// Draw the 2nd graph
$DataSet->RemoveSerie("Serie1");
$DataSet->AddSerie("Serie2");
$DataSet->SetYAxisName("Web Hits");
$Test->drawRightScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 213, 217, 221, TRUE, 0, 0);
$Test->drawGrid(4, TRUE, 230, 230, 230, 10);
$Test->setShadowProperties(3, 3, 0, 0, 0, 30, 4);
$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription());
$Test->clearShadow();
$Test->drawFilledCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription(), 0.1, 30);
$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255);
// Write the legend (box less)
$Test->setFontProperties("../Fonts/tahoma.ttf", 8);
$Test->drawLegend(530, 5, $DataSet->GetDataDescription(), 0, 0, 0, 0, 0, 0, 255, 255, 255, FALSE);
// Write the title
$Test->setFontProperties("../Fonts/MankSans.ttf", 18);
$Test->setShadowProperties(1, 1, 0, 0, 0);
$Test->drawTitle(0, 0, "SourceForge ranking summary", 255, 255, 255, 660, 30, TRUE);
$Test->clearShadow();
// Render the picture
    }
}
include STARRATING_CHART_PATH . "pchart/pData.class";
include STARRATING_CHART_PATH . "pchart/pChart.class";
$DataSet = new pData();
$DataSet->AddPoint($vote, "Serie1");
$DataSet->AddPoint($rate, "Serie2");
$DataSet->AddPoint($date, "Serie3");
$DataSet->AddSerie("Serie1");
$DataSet->SetAbsciseLabelSerie("Serie3");
$DataSet->SetSerieName("Votes", "Serie1");
$DataSet->SetSerieName("Rating", "Serie2");
$chart = new pChart(750, 380);
$chart->loadColorPalette(STARRATING_CHART_PATH . "colors/default.palette");
$chart->drawFilledRoundedRectangle(7, 7, 743, 373, 5, 240, 240, 240);
$chart->drawRoundedRectangle(5, 5, 745, 375, 5, 230, 230, 230);
$chart->setFontProperties(STARRATING_CHART_PATH . "fonts/quicksand.ttf", 8);
$chart->setGraphArea(60, 40, 695, 290);
$DataSet->SetYAxisName("Votes");
$chart->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 90, 0);
$chart->drawGrid(4, TRUE, 230, 230, 230, 50);
$chart->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
$chart->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 2, 1, 255, 255, 255);
$chart->clearScale();
$DataSet->RemoveSerie("Serie1");
$DataSet->AddSerie("Serie2");
$DataSet->SetYAxisName("Ratings");
$chart->drawRightScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 90, 0);
$chart->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
$chart->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 2, 1, 255, 255, 255);
$chart->Stroke();