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


PHP pData::getMax方法代码示例

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


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

示例1: pData


//.........这里部分代码省略.........
     $graphImage->setGraphArea($this->marginleft, $this->margintop, $this->width_actual - $this->marginright, $this->height_actual - $this->marginbottom);
     //$scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE,"LabelRotation"=>30);
     //$graphImage->drawScale($scaleSettings);
     //$settings = array("Surrounding"=>-30,"InnerSurrounding"=>30);
     //$graphImage->drawBarChart($settings);
     //$graphImage->autoOutput("pictures/example.drawBarChart.simple.png");
     //return;
     // Before plotting a series ensure they are all not drawable.
     /// Plot the chart data
     $stackeddrawn = false;
     $stackedexists = false;
     $barexists = false;
     foreach ($this->plot as $k => $v) {
         if ($v["type"] == "STACKEDBAR") {
             $stackedexists = true;
         }
         if ($v["type"] == "STACKEDBAR" || $v["type"] == "BAR") {
             $barexists = true;
         }
     }
     /* Draw the scale */
     $scaleSettings = array("GridR" => 200, "GridG" => 200, "GridB" => 200, "DrawSubTicks" => TRUE, "CycleBackground" => TRUE, "LabelRotation" => 30);
     // For stacked charts fix up the Max and Min values;
     if ($stackedexists) {
         $scaleMin = "Unknown";
         $scaleMax = 0;
         foreach ($this->plot as $k => $v) {
             if ($v["type"] == "BAR" || $v["type"] == "STACKEDBAR") {
                 $series = $v["name"] . $k;
                 $min = $graphData->getMin($series);
                 if ($scaleMin == "Unknown" || $min < $scaleMin) {
                     $scaleMin = $min;
                 }
                 $scaleMax = $scaleMax + $graphData->getMax($series);
             }
         }
         if ($scaleMin > 0) {
             $scaleMin = 0;
         }
         $range = $scaleMax - $scaleMin;
         // Make scales based on 5% of the range of values
         $scaleMax = round($range * 0.05 + $scaleMax);
         if ($scaleMin < 0) {
             $scaleMin = $scaleMin - round($range * 0.05);
         }
         $AxisBoundaries = array(0 => array("Min" => $scaleMin, "Max" => $scaleMax));
         $scaleSettings["Mode"] = SCALE_MODE_MANUAL;
         $scaleSettings["ManualScale"] = $AxisBoundaries;
     } else {
         if ($barexists) {
             $scaleMin = "Unknown";
             $scaleMax = 0;
             foreach ($this->plot as $k => $v) {
                 if ($v["type"] == "BAR" || $v["type"] == "STACKEDBAR") {
                     $series = $v["name"] . $k;
                     $min = $graphData->getMin($series);
                     if ($scaleMin == "Unknown" || $min < $scaleMin) {
                         $scaleMin = $min;
                     }
                     $max = $graphData->getMax($series);
                     if ($scaleMax == "Unknown" || $max > $scaleMax) {
                         $scaleMax = $max;
                     }
                 }
             }
             if ($scaleMin > 0) {
开发者ID:lihaobin0320,项目名称:yii2-reportico,代码行数:67,代码来源:swgraph_pchart3.php

示例2: array

$myPicture->setGraphArea(58, 27, 816, 228);
/* Draw a rectangle */
$myPicture->drawFilledRectangle(58, 27, 816, 228, array("R" => 0, "G" => 0, "B" => 0, "Dash" => TRUE, "DashR" => 0, "DashG" => 51, "DashB" => 51, "BorderR" => 0, "BorderG" => 0, "BorderB" => 0));
/* Turn on shadow computing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 20));
/* Draw the scale */
$myPicture->setFontProperties(array("R" => 255, "G" => 255, "B" => 255));
$ScaleSettings = array("XMargin" => 4, "DrawSubTicks" => TRUE, "GridR" => 255, "GridG" => 255, "GridB" => 255, "AxisR" => 255, "AxisG" => 255, "AxisB" => 255, "GridAlpha" => 30, "CycleBackground" => TRUE);
$myPicture->drawScale($ScaleSettings);
/* Draw the spline chart */
$myPicture->drawFilledSplineChart();
/* Write the chart boundaries */
$BoundsSettings = array("MaxDisplayR" => 237, "MaxDisplayG" => 23, "MaxDisplayB" => 48, "MinDisplayR" => 23, "MinDisplayG" => 144, "MinDisplayB" => 237);
$myPicture->writeBounds(BOUND_BOTH, $BoundsSettings);
/* Write the 0 line */
$myPicture->drawThreshold(0, array("WriteCaption" => TRUE));
/* Write the chart legend */
$myPicture->setFontProperties(array("R" => 255, "G" => 255, "B" => 255));
$myPicture->drawLegend(560, 266, array("Style" => LEGEND_NOBORDER));
/* Write the 1st data series statistics */
$Settings = array("R" => 188, "G" => 224, "B" => 46, "Align" => TEXT_ALIGN_BOTTOMLEFT);
$myPicture->drawText(620, 270, "Max : " . ceil($MyData->getMax("Probe 1")), $Settings);
$myPicture->drawText(680, 270, "Min : " . ceil($MyData->getMin("Probe 1")), $Settings);
$myPicture->drawText(740, 270, "Avg : " . ceil($MyData->getSerieAverage("Probe 1")), $Settings);
/* Write the 2nd data series statistics */
$Settings = array("R" => 224, "G" => 100, "B" => 46, "Align" => TEXT_ALIGN_BOTTOMLEFT);
$myPicture->drawText(620, 283, "Max : " . ceil($MyData->getMax("Probe 2")), $Settings);
$myPicture->drawText(680, 283, "Min : " . ceil($MyData->getMin("Probe 2")), $Settings);
$myPicture->drawText(740, 283, "Avg : " . ceil($MyData->getSerieAverage("Probe 2")), $Settings);
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawFilledSplineChart.png");
开发者ID:Esleelkartea,项目名称:herramienta_para_autodiagnostico_ADEADA,代码行数:31,代码来源:example.drawFilledSplineChart.php

示例3: array

$myPicture->setGraphArea(48, 17, 680, 190);
/* Draw a rectangle */
$myPicture->drawFilledRectangle(53, 22, 675, 185, array("R" => 0, "G" => 0, "B" => 0, "Dash" => TRUE, "DashR" => 0, "DashG" => 51, "DashB" => 51, "BorderR" => 0, "BorderG" => 0, "BorderB" => 0));
/* Turn on shadow computing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 20));
/* Draw the scale */
$myPicture->setFontProperties(array("R" => 255, "G" => 255, "B" => 255));
$ScaleSettings = array("XMargin" => 5, "YMargin" => 5, "Floating" => TRUE, "DrawSubTicks" => TRUE, "GridR" => 255, "GridG" => 255, "GridB" => 255, "AxisR" => 255, "AxisG" => 255, "AxisB" => 255, "GridAlpha" => 30, "CycleBackground" => TRUE);
$myPicture->drawScale($ScaleSettings);
/* Define the visual thresholds */
$Threshold = "";
$Threshold[] = array("Min" => -100, "Max" => -35, "R" => 117, "G" => 140, "B" => 240, "Alpha" => 40);
$Threshold[] = array("Min" => -35, "Max" => 35, "R" => 240, "G" => 232, "B" => 20, "Alpha" => 60);
$Threshold[] = array("Min" => 35, "Max" => 100, "R" => 240, "G" => 121, "B" => 20, "Alpha" => 80);
/* Draw the spline chart */
$myPicture->drawFilledSplineChart(array("Threshold" => $Threshold));
/* Write the chart boundaries */
$BoundsSettings = array("MaxDisplayR" => 237, "MaxDisplayG" => 23, "MaxDisplayB" => 48, "MinDisplayR" => 23, "MinDisplayG" => 144, "MinDisplayB" => 237);
$myPicture->writeBounds(BOUND_BOTH, $BoundsSettings);
/* Write the 0 line */
$myPicture->drawThreshold(0, array("WriteCaption" => TRUE));
/* Write the chart legend */
$myPicture->setFontProperties(array("R" => 255, "G" => 255, "B" => 255));
$myPicture->drawLegend(620, 217, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
/* Write the 1st data series statistics */
$Settings = array("R" => 188, "G" => 224, "B" => 46, "Align" => TEXT_ALIGN_BOTTOMLEFT);
$myPicture->drawText(10, 222, "Max : " . ceil($MyData->getMax("Probe 1")), $Settings);
$myPicture->drawText(60, 222, "Min : " . ceil($MyData->getMin("Probe 1")), $Settings);
$myPicture->drawText(110, 222, "Avg : " . ceil($MyData->getSerieAverage("Probe 1")), $Settings);
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawFilledSplineChart.png");
开发者ID:josepabloapu,项目名称:statistical-analysis-tools-lamp,代码行数:31,代码来源:example.drawFilledSplineChart.threshold.php

示例4: tests_pchart3

 public static function tests_pchart3()
 {
     /* @ 700x230 Filled spline chart drawing example. */
     /* pChart library inclusions */
     include 'lib/pChart/class/pData.class';
     include 'lib/pChart/class/pDraw.class';
     include 'lib/pChart/class/pImage.class';
     /* Create and populate the pData object */
     $MyData = new pData();
     $MyData->setAxisName(0, "Strength");
     for ($i = 0; $i <= 720; $i = $i + 20) {
         $MyData->addPoints(cos(deg2rad($i)) * 100, "Probe 1");
         $MyData->addPoints(cos(deg2rad($i + 90)) * 60, "Probe 2");
     }
     /* Create the pChart object */
     $myPicture = new pImage(847, 304, $MyData);
     $myPicture->drawGradientArea(0, 0, 847, 304, DIRECTION_VERTICAL, array("StartR" => 47, "StartG" => 47, "StartB" => 47, "EndR" => 17, "EndG" => 17, "EndB" => 17, "Alpha" => 100));
     $myPicture->drawGradientArea(0, 250, 847, 304, DIRECTION_VERTICAL, array("StartR" => 47, "StartG" => 47, "StartB" => 47, "EndR" => 27, "EndG" => 27, "EndB" => 27, "Alpha" => 100));
     $myPicture->drawLine(0, 249, 847, 249, array("R" => 0, "G" => 0, "B" => 0));
     $myPicture->drawLine(0, 250, 847, 250, array("R" => 70, "G" => 70, "B" => 70));
     /* Add a border to the picture */
     $myPicture->drawRectangle(0, 0, 846, 303, array("R" => 204, "G" => 204, "B" => 204));
     /* Write the picture title */
     $myPicture->setFontProperties(array("FontName" => CINTIENT_INSTALL_DIR . "lib/pChart/fonts/pf_arma_five.ttf", "FontSize" => 6));
     $myPicture->drawText(423, 14, "Cyclic magnetic field strength", array("R" => 255, "G" => 255, "B" => 255, "Align" => TEXT_ALIGN_MIDDLEMIDDLE));
     /* Define the chart area */
     $myPicture->setGraphArea(58, 27, 816, 228);
     /* Draw a rectangle */
     $myPicture->drawFilledRectangle(58, 27, 816, 228, array("R" => 0, "G" => 0, "B" => 0, "Dash" => TRUE, "DashR" => 0, "DashG" => 51, "DashB" => 51, "BorderR" => 0, "BorderG" => 0, "BorderB" => 0));
     /* Turn on shadow computing */
     $myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 20));
     /* Draw the scale */
     $myPicture->setFontProperties(array("R" => 255, "G" => 255, "B" => 255));
     $ScaleSettings = array("XMargin" => 4, "DrawSubTicks" => TRUE, "GridR" => 255, "GridG" => 255, "GridB" => 255, "AxisR" => 255, "AxisG" => 255, "AxisB" => 255, "GridAlpha" => 30, "CycleBackground" => TRUE);
     $myPicture->drawScale($ScaleSettings);
     /* Draw the spline chart */
     $myPicture->drawFilledSplineChart();
     /* Write the chart boundaries */
     $BoundsSettings = array("MaxDisplayR" => 237, "MaxDisplayG" => 23, "MaxDisplayB" => 48, "MinDisplayR" => 23, "MinDisplayG" => 144, "MinDisplayB" => 237);
     $myPicture->writeBounds(BOUND_BOTH, $BoundsSettings);
     /* Write the 0 line */
     $myPicture->drawThreshold(0, array("WriteCaption" => TRUE));
     /* Write the chart legend */
     $myPicture->setFontProperties(array("R" => 255, "G" => 255, "B" => 255));
     $myPicture->drawLegend(560, 266, array("Style" => LEGEND_NOBORDER));
     /* Write the 1st data series statistics */
     $Settings = array("R" => 188, "G" => 224, "B" => 46, "Align" => TEXT_ALIGN_BOTTOMLEFT);
     $myPicture->drawText(620, 270, "Max : " . ceil($MyData->getMax("Probe 1")), $Settings);
     $myPicture->drawText(680, 270, "Min : " . ceil($MyData->getMin("Probe 1")), $Settings);
     $myPicture->drawText(740, 270, "Avg : " . ceil($MyData->getSerieAverage("Probe 1")), $Settings);
     /* Write the 2nd data series statistics */
     $Settings = array("R" => 224, "G" => 100, "B" => 46, "Align" => TEXT_ALIGN_BOTTOMLEFT);
     $myPicture->drawText(620, 283, "Max : " . ceil($MyData->getMax("Probe 2")), $Settings);
     $myPicture->drawText(680, 283, "Min : " . ceil($MyData->getMin("Probe 2")), $Settings);
     $myPicture->drawText(740, 283, "Avg : " . ceil($MyData->getSerieAverage("Probe 2")), $Settings);
     /* Render the picture (choose the best way) */
     $myPicture->autoOutput("pictures/example.drawFilledSplineChart.png");
 }
开发者ID:rasismeiro,项目名称:cintient,代码行数:58,代码来源:TemplateManager.php

示例5:

$MyData->setSerieOnAxis("Humidity", 1);
/* Setup Series Y-Axis 1 Location */
$MyData->setAxisPosition(1, AXIS_POSITION_RIGHT);
/* Set Y-Axis Series 0 name */
$MyData->setAxisName(0, "Temperature");
/* Set Y-Axis Series 1 name */
$MyData->setAxisName(1, "Humidity");
/* Set Y-Axis Series 0 Units */
$MyData->setAxisUnit(0, "°C");
/* Set Y-Axis Series 1 Units */
$MyData->setAxisUnit(1, "%");
////////////////////////////////////////////////////////////////
// Maximum Values
//
/* Get maximum Temperature Value */
$temp = $MyData->getMax("Temperature");
/* Get maximum Temperature Value */
$T_Maximum = number_format($temp, 1);
/* Get maximum Humidity Value */
$temp = $MyData->getMax("Humidity");
/* Format Max to 1 decimal place */
$H_Maximum = number_format($temp, 1);
////////////////////////////////////////////////////////////////
// Average Values
//
/* get average Temperature value */
$temp = $MyData->getSerieAverage("Temperature");
/* format average to 3 decimal places */
$T_Average = number_format($temp, 1);
/* get average Humidity value */
$temp = $MyData->getSerieAverage("Humidity");
开发者ID:snowsquizy,项目名称:RASP_PI_DHT22,代码行数:31,代码来源:monthly.php

示例6: die

        $result_alumno = mysqli_query($conn, $sql_alumno);
        $row = mysqli_fetch_array($result_alumno, MYSQLI_NUM);
        $value2 = $row[0];
        $sql = "SELECT Nota FROM notas" . $curso . " WHERE N_Id_Escolar = '{$value2}' \n            AND id_asignatura = '{$asignatura}';";
        $result = mysqli_query($conn, $sql) or die("Error en el sql");
        $series[$value] = array();
        while ($row = mysqli_fetch_array($result, MYSQLI_NUM)) {
            $series[$value][] = $row[0];
        }
    }
    $myData = new pData();
    $html = "<table border='1'>\n      <tr>\n        <th>Alumno</th>\n        <th>Nota media</th>\n        <th>Desviación estándar</th>\n        <th>Mediana</th>\n        <th>Nota más alta</th>\n      </tr>";
    foreach ($series as $key => $value) {
        $myData->addPoints($value, $key);
        $media = round($myData->getSerieAverage($key), 2);
        $maxima = $myData->getMax($key);
        $mediana = $myData->getSerieMedian($key);
        $desviacion = round($myData->getStandardDeviation($key), 2);
        $html .= "<tr><td>{$key}</td><td>{$media}</td>" . "<td>{$desviacion}</td><td>{$mediana}</td>" . "<td>{$maxima}</td></tr>";
    }
    $html .= "</table>";
    echo $html;
}
?>
      </div>
              </div>
        </div>
    </div>


    <!-- Pie de página -->
开发者ID:AitorMotril,项目名称:eduGraph,代码行数:31,代码来源:estadisticas.php

示例7: array

    }
}
/* Draw the scale */
$scaleSettings = array("GridR" => 200, "GridG" => 200, "GridB" => 200, "DrawSubTicks" => TRUE, "CycleBackground" => TRUE, "LabelRotation" => 30);
// For stacked charts fix up the Max and Min values;
if ($stackedexists) {
    $scaleMin = "Unknown";
    $scaleMax = 0;
    foreach ($plot as $k => $v) {
        if ($v["type"] == "BAR" || $v["type"] == "STACKEDBAR") {
            $series = $v["name"] . $k;
            $min = $graphData->getMin($series);
            if ($scaleMin == "Unknown" || $min < $scaleMin) {
                $scaleMin = $min;
            }
            $scaleMax = $scaleMax + $graphData->getMax($series);
        }
    }
    if ($scaleMin > 0) {
        $scaleMin = 0;
    }
    $range = $scaleMax - $scaleMin;
    // Make scales based on 5% of the range of values
    $scaleMax = round($range * 0.05 + $scaleMax);
    if ($scaleMin < 0) {
        $scaleMin = $scaleMin - round($range * 0.05);
    }
    $AxisBoundaries = array(0 => array("Min" => $scaleMin, "Max" => $scaleMax));
    $scaleSettings["Mode"] = SCALE_MODE_MANUAL;
    $scaleSettings["ManualScale"] = $AxisBoundaries;
} else {
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:dyngraph_pchart3.php


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