当前位置: 首页>>代码示例>>PHP>>正文


PHP pImage::drawStackedAreaChart方法代码示例

本文整理汇总了PHP中pImage::drawStackedAreaChart方法的典型用法代码示例。如果您正苦于以下问题:PHP pImage::drawStackedAreaChart方法的具体用法?PHP pImage::drawStackedAreaChart怎么用?PHP pImage::drawStackedAreaChart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pImage的用法示例。


在下文中一共展示了pImage::drawStackedAreaChart方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

 $myPicture->drawScale($scaleSettings);
 // 隐藏副坐标轴数据
 if (isset($arrSeriesY2)) {
     foreach ($arrSeriesY2 as $serie) {
         $myData->setSerieDrawable($serie, FALSE);
     }
 }
 $arrDisplayValues = array("DisplayValues" => FALSE);
 if ($plot == 2) {
     $arrDisplayValues["DisplayValues"] = TRUE;
 }
 /* Enable shadow computing */
 $myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
 /* Draw the stacked area chart */
 if ($chartType == 'area2') {
     $myPicture->drawStackedAreaChart();
 } else {
     if ($chartType == 'bar') {
         $myPicture->drawBarChart(array("Surrounding" => -15, "InnerSurrounding" => 15) + $arrDisplayValues);
     } else {
         if ($chartType == 'bar2') {
             $myPicture->drawStackedBarChart();
         } else {
             $myPicture->drawLineChart();
             if ($plot > 0) {
                 $myPicture->drawPlotChart($arrDisplayValues + array("PlotSize" => $weight * 1.5 + 3, "PlotBorder" => TRUE, "BorderSize" => 0.8, "BorderAlpha" => 75, "Surrounding" => -30));
             }
         }
     }
 }
 // 隐藏主坐标轴数据,画副坐标轴数据
开发者ID:Strongc,项目名称:php_chart,代码行数:31,代码来源:chart_png_sxm.php

示例2: pData

/* CAT:Stacked chart */
/* pChart library inclusions */
include "class/pData.class.php";
include "class/pDraw.class.php";
include "class/pImage.class.php";
/* Create and populate the pData object */
$MyData = new pData();
$MyData->addPoints(array(4, 1, 0, 12, 8, 4, 0, 12, 8), "Frontend #1");
$MyData->addPoints(array(3, 12, 15, 8, VOID, VOID, 12, 15, 8), "Frontend #2");
$MyData->addPoints(array(4, 4, 4, 4, 4, 4, 4, 4, 4), "Frontend #3");
$MyData->setAxisName(0, "Average Usage");
$MyData->addPoints(array("January", "February", "March", "April", "May", "June", "July", "August", "September"), "Labels");
$MyData->setSerieDescription("Labels", "Months");
$MyData->setAbscissa("Labels");
/* Create the pChart object */
$myPicture = new pImage(700, 230, $MyData);
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, array("StartR" => 240, "StartG" => 240, "StartB" => 240, "EndR" => 180, "EndG" => 180, "EndB" => 180, "Alpha" => 100));
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_HORIZONTAL, array("StartR" => 240, "StartG" => 240, "StartB" => 240, "EndR" => 180, "EndG" => 180, "EndB" => 180, "Alpha" => 20));
/* Set the default font properties */
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
/* Draw the scale and the chart */
$myPicture->setGraphArea(60, 20, 680, 190);
$myPicture->drawScale(array("XMargin" => 10, "YMargin" => 10, "Floating" => TRUE, "DrawSubTicks" => TRUE, "Mode" => SCALE_MODE_ADDALL_START0));
$myPicture->drawStackedAreaChart(array("DrawPlot" => TRUE, "DrawLine" => TRUE, "LineSurrounding" => -20));
/* Turn on shadow processing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
/* Write the chart legend */
$myPicture->drawLegend(480, 210, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawStackedAreaChart.simple.png");
开发者ID:Basia2B,项目名称:BugTrackerDell,代码行数:30,代码来源:example.drawStackedAreaChart.simple.php

示例3: PlotLine

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();
}
开发者ID:tarekdjouad,项目名称:TBIMS,代码行数:66,代码来源:Plot.php

示例4: createCharts


//.........这里部分代码省略.........
                 //$archiveDb->addArchive($y.$ym, $dataDb, $user['clientid']);
                 $months[$y . $ym] = $y . '/' . $ym;
             }
             ++$m;
             if ($m > 12) {
                 $m = 0;
             }
         }
         ++$y;
         $m = 1;
     }
     //Merge subcategories to main categories
     foreach ($turnoverCategories as $id => $values) {
         if (isset($options['categories'][$id]['childs']) && $id != $params['catid']) {
             foreach ($options['categories'][$id]['childs'] as $childId) {
                 foreach ($values as $month => $value) {
                     $turnoverCategories[$id][$month] += $turnoverCategories[$childId][$month];
                 }
                 unset($turnoverCategories[$childId]);
             }
         }
     }
     //Remove empty arrays
     foreach ($turnoverCategories as $key => $values) {
         if (!array_sum($values)) {
             unset($turnoverCategories[$key]);
         }
     }
     require_once BASE_PATH . '/library/pChart/class/pData.class.php';
     require_once BASE_PATH . '/library/pChart/class/pDraw.class.php';
     require_once BASE_PATH . '/library/pChart/class/pImage.class.php';
     //Turnover
     /* Create your dataset object */
     $turnoverData = new pData();
     /* Add data in your dataset */
     $turnoverData->addPoints($turnover, 'Values');
     $turnoverData->setAxisName(0, '€ / Netto');
     /* Create the X serie */
     $turnoverData->addPoints($months, 'Labels');
     $turnoverData->setSerieDescription('Labels', 'Months');
     $turnoverData->setAbscissa('Labels');
     /* Create a pChart object and associate your dataset */
     $turnover = new pImage($width, $height, $turnoverData);
     /* Turn off AA processing */
     $turnover->Antialias = FALSE;
     /* Choose a nice font */
     $turnover->setFontProperties(array('FontName' => BASE_PATH . '/library/pChart/fonts/verdana.ttf', 'FontSize' => 10));
     /* Define the boundaries of the graph area */
     $turnover->setGraphArea(75, 20, $width - 30, $height - 60);
     /* Draw the scale, keep everything automatic */
     $turnover->drawScale(array('DrawSubTicks' => TRUE, 'Mode' => SCALE_MODE_START0, 'LabelRotation' => 45));
     /* Draw the scale, keep everything automatic */
     $settings = array('Gradient' => TRUE, 'GradientMode' => GRADIENT_EFFECT_CAN, 'DisplayPos' => LABEL_POS_INSIDE, 'DisplayValues' => TRUE, 'DisplayR' => 0, 'DisplayG' => 0, 'DisplayB' => 0, 'DisplayShadow' => TRUE, 'Surrounding' => 10);
     $turnover->drawBarChart($settings);
     /* Build the PNG file and send it to the web browser */
     if (!file_exists(BASE_PATH . '/cache/chart/')) {
         mkdir(BASE_PATH . '/cache/chart/');
         chmod(BASE_PATH . '/cache/chart/', 0777);
     }
     $turnover->Render(BASE_PATH . '/cache/chart/turnover-' . $width . '-' . $height . '.png');
     //Turnover by categories
     /* Create your dataset object */
     $turnoverCategoriesData = new pData();
     /* Add data in your dataset */
     $turnoverCategoriesTotal = array();
     foreach ($turnoverCategories as $key => $value) {
         $turnoverCategoriesTotal[$key] = array_sum($value);
     }
     arsort($turnoverCategoriesTotal);
     foreach ($turnoverCategoriesTotal as $key => $value) {
         if ($key && isset($options['categories'][$key])) {
             $turnoverCategoriesData->addPoints($turnoverCategories[$key], $options['categories'][$key]['title']);
         }
     }
     if (isset($turnoverCategories[0])) {
         $turnoverCategoriesData->addPoints($turnoverCategories[0], $statisticsUncategorized);
     }
     $turnoverCategoriesData->setAxisName(0, '€ / Netto');
     /* Create the X serie */
     $turnoverCategoriesData->addPoints($months, 'Labels');
     $turnoverCategoriesData->setSerieDescription('Labels', 'Months');
     $turnoverCategoriesData->setAbscissa('Labels');
     /* Create a pChart object and associate your dataset */
     $turnoverCategories = new pImage($width, $height, $turnoverCategoriesData);
     /* Turn off AA processing */
     $turnoverCategories->Antialias = FALSE;
     /* Choose a nice font */
     $turnoverCategories->setFontProperties(array('FontName' => BASE_PATH . '/library/pChart/fonts/verdana.ttf', 'FontSize' => 10));
     /* Define the boundaries of the graph area */
     $turnoverCategories->setGraphArea(75, 20, $width - 30, $height - 60);
     /* Draw the scale, keep everything automatic */
     $turnoverCategories->drawScale(array('XMargin' => 2, 'DrawSubTicks' => TRUE, 'Mode' => SCALE_MODE_ADDALL_START0, 'LabelRotation' => 45));
     /* Draw the scale, keep everything automatic */
     $settings = array();
     $turnoverCategories->drawStackedAreaChart($settings);
     /* Write the chart legend */
     $turnoverCategories->drawLegend(100, 20, array('Style' => LEGEND_NOBORDER, 'Mode' => LEGEND_VERTICAL));
     /* Build the PNG file and send it to the web browser */
     $turnoverCategories->Render(BASE_PATH . '/cache/chart/turnover-category-' . $width . '-' . $height . '.png');
 }
开发者ID:dewawi,项目名称:dewawi,代码行数:101,代码来源:Charts.php

示例5: array

$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, "drawStackedAreaChart() - draw a stacked area 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, "Mode" => SCALE_MODE_ADDALL));
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
$myPicture->setShadow(FALSE);
$myPicture->drawStackedAreaChart(array("DisplayValues" => TRUE, "DisplayColor" => DISPLAY_AUTO, "DrawPlot" => TRUE, "DrawLine" => TRUE, "LineSurrounding" => -250));
/* Draw one static threshold */
$myPicture->drawThreshold(0, array("Alpha" => 70, "Ticks" => 1, "NoMargin" => TRUE));
/* 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, "Mode" => SCALE_MODE_ADDALL, "DrawSubTicks" => TRUE));
$myPicture->setShadow(FALSE);
$myPicture->drawStackedAreaChart(array("Surrounding" => 10));
/* Draw one static threshold */
$myPicture->drawThreshold(0, array("Alpha" => 70, "Ticks" => 1, "NoMargin" => TRUE));
/* 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.drawStackedAreaChart.png");
开发者ID:ambagasdowa,项目名称:projections,代码行数:31,代码来源:example.drawStackedAreaChart.php

示例6: pData

/* pChart library inclusions */
include "../class/pData.class.php";
include "../class/pDraw.class.php";
include "../class/pImage.class.php";
/* Create and populate the pData object */
$MyData = new pData();
$MyData->addPoints(array(4, 0, 0, 12, 8, 3, 0, 12, 8), "Frontend #1");
$MyData->addPoints(array(3, 12, 15, 8, 5, 5, 12, 15, 8), "Frontend #2");
$MyData->addPoints(array(2, 7, 5, 18, 19, 22, 7, 5, 18), "Frontend #3");
$MyData->setAxisName(0, "Average Usage");
$MyData->addPoints(array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jui", "Aug", "Sep"), "Labels");
$MyData->setSerieDescription("Labels", "Months");
$MyData->setAbscissa("Labels");
/* Normalize the data series to 100% */
$MyData->normalize(100, "%");
/* Create the pChart object */
$myPicture = new pImage(700, 230, $MyData);
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, array("StartR" => 240, "StartG" => 240, "StartB" => 240, "EndR" => 180, "EndG" => 180, "EndB" => 180, "Alpha" => 100));
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_HORIZONTAL, array("StartR" => 240, "StartG" => 240, "StartB" => 240, "EndR" => 180, "EndG" => 180, "EndB" => 180, "Alpha" => 20));
/* Set the default font properties */
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
/* Draw the scale and the chart */
$myPicture->setGraphArea(60, 20, 680, 190);
$myPicture->drawScale(array("XMargin" => 2, "DrawSubTicks" => TRUE, "Mode" => SCALE_MODE_ADDALL));
$myPicture->drawStackedAreaChart(array("Surrounding" => 60));
/* Turn on shadow processing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
/* Write the chart legend */
$myPicture->drawLegend(480, 210, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawStackedAreaChart.normalized.png");
开发者ID:OUARKA,项目名称:qcm-cms,代码行数:31,代码来源:example.drawStackedAreaChart.normalized.php

示例7: dumpArray

    if ($Mode == "Render") {
        $myPicture->drawStackedBarChart($Config);
    } else {
        echo dumpArray("Config", $Config);
        echo '$myPicture->drawStackedBarChart($Config);' . "\r\n";
    }
}
if ($c_family == "sarea") {
    if ($c_forced_transparency == "true") {
        $Config["ForceTransparency"] = $c_transparency;
    }
    if ($c_around_zero2 == "true") {
        $Config["AroundZero"] = TRUE;
    }
    if ($Mode == "Render") {
        $myPicture->drawStackedAreaChart($Config);
    } else {
        echo dumpArray("Config", $Config);
        echo '$myPicture->drawStackedAreaChart($Config);' . "\r\n";
    }
}
if ($t_enabled == "true") {
    list($R, $G, $B) = extractColors($t_color);
    $Config = "";
    $Config["R"] = $R;
    $Config["G"] = $G;
    $Config["B"] = $B;
    $Config["Alpha"] = $t_alpha;
    if (isset($myData->Data["Axis"][$t_axis])) {
        $Config["AxisID"] = $t_axis;
    }
开发者ID:ambagasdowa,项目名称:projections,代码行数:31,代码来源:render.php

示例8: array

$Settings = array("R" => 170, "G" => 183, "B" => 87, "Dash" => 1, "DashR" => 190, "DashG" => 203, "DashB" => 107);
$myPicture->drawFilledRectangle(0, 0, 700, 230, $Settings);
/* 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, "drawStackedAreaChart() - draw a stacked area 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, "Mode" => SCALE_MODE_ADDALL));
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
$myPicture->setShadow(FALSE);
$myPicture->drawStackedAreaChart(array("DisplayValues" => TRUE, "DisplayColor" => DISPLAY_AUTO, "Surrounding" => 20));
/* 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, "Mode" => SCALE_MODE_ADDALL, "DrawSubTicks" => TRUE));
$myPicture->setShadow(FALSE);
$myPicture->drawStackedAreaChart(array("Surrounding" => 10));
/* 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.drawStackedAreaChart.png");
开发者ID:Esleelkartea,项目名称:herramienta_para_autodiagnostico_ADEADA,代码行数:31,代码来源:example.drawStackedAreaChart.php

示例9: drawOverAllImage

 private function drawOverAllImage($date)
 {
     $res1 = $this->dataForGraph($date, 0);
     $res2 = $this->dataForGraph($date, 1);
     $MyData = new pData();
     $MyData->addPoints($res1['percents'], "Load in % for server 1");
     $MyData->addPoints($res2['percents'], "Load in % for server 2");
     $MyData->setAxisName(0, "Participants");
     $MyData->addPoints($res1['times'], "Labels");
     //        $MyData->addPoints($res2['times'], "Labels");
     $MyData->setSerieDescription("Labels", "Months");
     $MyData->setAbscissa("Labels");
     /* Create the pChart object */
     $myPicture = new pImage(1200, 560, $MyData);
     /* Turn of Antialiasing */
     $myPicture->Antialias = TRUE;
     /* Add a border to the picture */
     //$myPicture->drawRectangle(0,0,890,290,array("R"=>0,"G"=>0,"B"=>0));
     /* Write the chart title */
     $myPicture->setFontProperties(array("FontName" => CORE_REPOSITORY_REAL_PATH . "class/pChart/fonts/Forgotte.ttf", "FontSize" => 11));
     $myPicture->drawText(200, 35, "All Servers Resource Usage (" . $date . ")", array("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMMIDDLE));
     /* Set the default font */
     $myPicture->setFontProperties(array("FontName" => CORE_REPOSITORY_REAL_PATH . "class/pChart/fonts/pf_arma_five.ttf", "FontSize" => 8));
     /* Define the chart area */
     $myPicture->setGraphArea(60, 40, 1100, 500);
     $AxisBoundaries = array(0 => array("Min" => 0, "Max" => 100));
     /* Draw the scale */
     $scaleSettings = array("XMargin" => 10, "YMargin" => 10, "Floating" => TRUE, "GridR" => 200, "GridG" => 200, "GridB" => 200, "DrawSubTicks" => TRUE, "CycleBackground" => TRUE, "LabelSkip" => 1, 'Mode' => SCALE_MODE_MANUAL, "ManualScale" => $AxisBoundaries);
     $myPicture->drawScale($scaleSettings);
     $myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
     /* Draw the stacked area chart */
     $myPicture->drawStackedAreaChart(array("DrawLine" => TRUE, "LineSurrounding" => -20));
     /* Turn on Antialiasing */
     $myPicture->Antialias = TRUE;
     /* Draw the line chart */
     $myPicture->drawLineChart();
     /* Write the chart legend */
     $myPicture->drawLegend(800, 20, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
     /* Render the picture (choose the best way) */
     //$myPicture->autoOutput(App::$instance->opt->fizPath."class/pChart/pictures/example.drawLineChart.simple.png");
     $myPicture->render(CORE_REPOSITORY_REAL_PATH . "class/pChart/pictures/load_at_" . $date . "_on_overall.png");
     $path = CORE_REPOSITORY_HTTP_PATH . "class/pChart/pictures/load_at_" . $date . "_on_overall.png";
     if (ST::isAjaxRequest()) {
         $data = [];
         print json_encode($data['path'] = $path);
     } else {
         return $path;
     }
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:49,代码来源:Load_controller.php


注:本文中的pImage::drawStackedAreaChart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。