コード例 #1
0
$Test->setFontProperties("fonts/tahoma.ttf", 8);
$Test->setGraphArea(60, 40, 595, 190);
// Initialise graph area
$Test->setFontProperties("../Fonts/tahoma.ttf", 8);
// Draw the SourceForge Rank graph
$DataSet->SetYAxisName("Amount of Fuel Used");
$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(),.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
コード例 #2
0
    $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);
    $Chart->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription());
    $Chart->clearShadow();
    $Chart->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 1, 1, 255, 255, 255);
    $Chart->setFontProperties(IMAGE_PATH . '/sig/font/DejaVuSans.ttf', 7);
    $Chart->drawHorizontalLegend(235, -1, $DataSet->GetDataDescription(), 0, 0, 0, 0, 0, 0, $color['red'], $color['green'], $color['blue'], FALSE);
}
$cache_image = IMAGE_PATH . "/progress/trend_{$player}_{$last_time}.png";