Example #1
0
        $ysize = 600;
    }
}
$minscale = null;
$maxscale = null;
$type = "daily";
$interval = "1-hour";
$imagefilename = "../cache/daily/daily_{$date}.png";
$imagepath = "/cache/daily/daily_{$date}.png";
$altimage = $type . " namecoin graph for date {$date}";
$permalink = $siteurl . "/daily/nmc_daily.php?day=" . $date;
$link_daybefore = $siteurl . "/daily/nmc_daily.php?day=" . $date_daybefore;
$link_nextday = $siteurl . "/daily/nmc_daily.php?day=" . $date_nextday;
$navigation = "<a href=" . $link_daybefore . ">Day before</a> - <a href=" . $link_nextday . ">Next day</a>";
$title = $type . " namecoin historic data graph for date {$date}";
$graphgendate = "";
$cached = null;
$message = "daily graph is cached one hour";
if ($graphgendate = checkcache($imagefilename)) {
    $cached = true;
} else {
    $cached = false;
    /* Create and populate the pData object */
    $MyData = new pData();
    load_nmc_data($MyData, $date, $type, $minscale, $maxscale);
    //var_dump($MyData);
    //printf("minscale: $minscale maxscale: $maxscale <br />\n");
    $graphgendate = buildgraph($MyData, $xsize, $ysize, $title, $minscale, $maxscale, $date, $type, $imagefilename);
}
renderpage($title, $permalink, $altimage, $imagepath, $graphgendate, $message, $cached, $navigation);
Example #2
0
    $myPicture->setGraphArea(70, 60, $xsize - 40, $ysize - 30);
    $myPicture->drawFilledRectangle(70, 60, $xsize - 40, $ysize - 30, array("R" => 255, "G" => 255, "B" => 255, "Surrounding" => -200, "Alpha" => 10));
    //$MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),"Labels");
    //$MyData->setSerieDescription("Labels","Months");
    //$MyData->setAbscissa("Labels");
    $AxisBoundaries = array(0 => array("Min" => $minscale, "Max" => $maxscale));
    $myPicture->drawScale(array("DrawSubTicks" => TRUE, "CycleBackground" => TRUE, "Mode" => SCALE_MODE_MANUAL, "ManualScale" => $AxisBoundaries));
    //$myPicture->drawScale(array("DrawSubTicks"=>FALSE,"CycleBackground"=>TRUE ));
    //$myPicture->drawScale(array("DrawYLines"=>array(0)));
    /* Draw the 1st stock chart */
    $mystockChart = new pStock($myPicture, $MyData);
    $myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 30));
    $mystockChart->drawStockChart();
    /* Reset the display mode because of the graph small size */
    //$MyData->setAxisDisplay(0,AXIS_FORMAT_DEFAULT);
    /* Draw the 2nd scale */
    //$myPicture->setShadow(FALSE);
    //$myPicture->setGraphArea(500,60,670,190);
    //$myPicture->drawFilledRectangle(500,60,670,190,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10));
    //$myPicture->drawScale(array("Pos"=>SCALE_POS_TOPBOTTOM,"DrawSubTicks"=>TRUE));
    /* Draw the 2nd stock chart */
    //$mystockChart = new pStock($myPicture,$MyData);
    //$myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>30));
    //$mystockChart->drawStockChart();
    /* Render the picture (choose the best way) */
    //$myPicture->autoOutput("pictures/example.drawStockChart.png");
    $myPicture->render($imagefilename);
    $graphgendate = $current_time;
}
renderpage($title, $permalink, $altimage, $imagepath, $graphgendate, $message);