/* Overlay with a gradient */
$Settings = array("StartR" => 219, "StartG" => 231, "StartB" => 139, "EndR" => 1, "EndG" => 138, "EndB" => 68, "Alpha" => 50);
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, $Settings);
$myPicture->drawGradientArea(0, 0, 700, 20, DIRECTION_VERTICAL, array("StartR" => 0, "StartG" => 0, "StartB" => 0, "EndR" => 50, "EndG" => 50, "EndB" => 50, "Alpha" => 80));
/* Add a border to the picture */
$myPicture->drawRectangle(0, 0, 699, 229, array("R" => 0, "G" => 0, "B" => 0));
/* Write the picture title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Silkscreen.ttf", "FontSize" => 6));
$myPicture->drawText(10, 13, "drawFilledStepChart() - draw a filled step chart", array("R" => 255, "G" => 255, "B" => 255));
/* Write the chart title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Forgotte.ttf", "FontSize" => 11));
$myPicture->drawText(250, 55, "Average temperature", array("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMMIDDLE));
/* Draw the scale and the 1st chart */
$myPicture->setGraphArea(60, 60, 450, 190);
$myPicture->drawFilledRectangle(60, 60, 450, 190, array("R" => 255, "G" => 255, "B" => 255, "Surrounding" => -200, "Alpha" => 10));
$myPicture->drawScale(array("DrawSubTicks" => TRUE));
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
$myPicture->drawFilledStepChart(array("ForceTransparency" => 40, "DisplayValues" => TRUE, "DisplayColor" => DISPLAY_AUTO));
$myPicture->setShadow(FALSE);
/* Draw the scale and the 2nd chart */
$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));
$myPicture->setShadow(TRUE, array("X" => -1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
$myPicture->drawFilledStepChart(array("ForceTransparency" => 40));
$myPicture->setShadow(FALSE);
/* Write the chart legend */
$myPicture->drawLegend(510, 205, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawFilledStepChart.png");
Example #2
0
function PlotLine($rowX, $rowY, $name, $ch)
{
    include $_SERVER['DOCUMENT_ROOT'] . "/TBSIM/Lib/class/pData.class.php";
    include $_SERVER['DOCUMENT_ROOT'] . "/TBSIM/Lib/class/pDraw.class.php";
    include $_SERVER['DOCUMENT_ROOT'] . "/TBSIM/Lib/class/pImage.class.php";
    include $_SERVER['DOCUMENT_ROOT'] . "/TBSIM/Lib/class/pPie.class.php";
    //**************************************
    $myData = new pData();
    $myData->addPoints($rowX, "Serie1");
    $myData->setSerieDescription("Serie1", $name);
    //$myData->setSerieOnAxis("Serie1",0);
    $myData->addPoints($rowY, "Absissa");
    $myData->setAbscissa("Absissa");
    //$myData->addPoints(array("January","February","March","April","May","June","July","August"),"Absissa");
    //$myData->setAbscissa("Absissa");
    $myData->setAxisPosition(0, AXIS_POSITION_LEFT);
    //$myData->setAxisName(0,"1st axis");
    $myData->setAxisUnit(0, "");
    $myPicture = new pImage(700, 230, $myData);
    $Settings = array("R" => 240, "G" => 242, "B" => 241, "Dash" => 1, "DashR" => 260, "DashG" => 262, "DashB" => 261);
    $myPicture->drawFilledRectangle(0, 0, 700, 230, $Settings);
    $Settings = array("StartR" => 252, "StartG" => 255, "StartB" => 254, "EndR" => 252, "EndG" => 255, "EndB" => 254, "Alpha" => 50);
    $myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, $Settings);
    $myPicture->drawRectangle(0, 0, 699, 229, array("R" => 0, "G" => 0, "B" => 0));
    $myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 50, "G" => 50, "B" => 50, "Alpha" => 20));
    $myPicture->setFontProperties(array("FontName" => "fonts/Forgotte.ttf", "FontSize" => 14));
    $TextSettings = array("Align" => TEXT_ALIGN_MIDDLEMIDDLE, "R" => 252, "G" => 252, "B" => 252, "DrawBox" => 1, "BoxAlpha" => 30);
    //$myPicture->drawText(350,25,$name,$TextSettings);
    $myPicture->setShadow(FALSE);
    $myPicture->setGraphArea(50, 50, 675, 190);
    //$myPicture->setFontProperties(array("R"=>0,"G"=>0,"B"=>0,"FontName"=>"fonts/pf_arma_five.ttf","FontSize"=>6));
    $Settings = array("Pos" => SCALE_POS_LEFTRIGHT, "Mode" => SCALE_MODE_FLOATING, "LabelingMethod" => LABELING_ALL, "GridR" => 255, "GridG" => 255, "GridB" => 255, "GridAlpha" => 50, "TickR" => 0, "TickG" => 0, "TickB" => 0, "TickAlpha" => 50, "LabelRotation" => 0, "CycleBackground" => 1, "DrawXLines" => 1, "DrawSubTicks" => 1, "SubTickR" => 255, "SubTickG" => 0, "SubTickB" => 0, "SubTickAlpha" => 50, "DrawYLines" => ALL);
    $myPicture->drawScale($Settings);
    $myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 50, "G" => 50, "B" => 50, "Alpha" => 10));
    $Config = "";
    if ($ch == 1) {
        $myPicture->drawSplineChart($Config);
    }
    if ($ch == 2) {
        $myPicture->drawBarChart($Config);
    }
    if ($ch == 3) {
        $myPicture->drawLineChart($Config);
    }
    if ($ch == 4) {
        $myPicture->drawPlotChart($Config);
    }
    if ($ch == 5) {
        $myPicture->drawStepChart($Config);
    }
    if ($ch == 6) {
        $myPicture->drawAreaChart($Config);
    }
    if ($ch == 7) {
        $myPicture->drawFilledSplineChart($Config);
    }
    if ($ch == 8) {
        $myPicture->drawFilledStepChart($Config);
    }
    if ($ch == 9) {
        $myPicture->drawStackedAreaChart($Config);
    }
    $Config = array("FontR" => 0, "FontG" => 0, "FontB" => 0, "FontName" => "fonts/pf_arma_five.ttf", "FontSize" => 6, "Margin" => 6, "Alpha" => 30, "BoxSize" => 5, "Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL);
    $myPicture->drawLegend(563, 16, $Config);
    $myPicture->stroke();
}
Example #3
0
    } else {
        echo dumpArray("Config", $Config);
        echo '$myPicture->drawAreaChart($Config);' . "\r\n";
    }
}
if ($c_family == "fstep") {
    if ($c_forced_transparency == "true") {
        $Config["ForceTransparency"] = $c_transparency;
    }
    if ($c_around_zero2 == "true") {
        $Config["AroundZero"] = TRUE;
    } else {
        $Config["AroundZero"] = FALSE;
    }
    if ($Mode == "Render") {
        $myPicture->drawFilledStepChart($Config);
    } else {
        echo dumpArray("Config", $Config);
        echo '$myPicture->drawFilledStepChart($Config);' . "\r\n";
    }
}
if ($c_family == "fspline") {
    if ($c_forced_transparency == "true") {
        $Config["ForceTransparency"] = $c_transparency;
    }
    if ($c_around_zero2 == "true") {
        $Config["AroundZero"] = TRUE;
    }
    if ($Mode == "Render") {
        $myPicture->drawFilledSplineChart($Config);
    } else {