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


PHP pData::normalize方法代码示例

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


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

示例1: 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, 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" => 1, "DrawSubTicks" => TRUE, "Mode" => SCALE_MODE_ADDALL_START0));
/* Turn on shadow processing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
/* Draw the stacked area chart */
$myPicture->drawStackedAreaChart(array("DrawPlot" => TRUE, "DrawLine" => TRUE, "LineSurrounding" => -20));
/* Write the chart legend */
$myPicture->drawLegend(480, 210, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
开发者ID:ambagasdowa,项目名称:projections,代码行数:31,代码来源:example.drawStackedAreaChart.normalized.php

示例2: pImage

    }
    $myData->setAxisName(2, $d_axis2_name);
    $myData->setAxisUnit(2, $d_axis2_unit);
    if ($Mode == "Source") {
        if ($d_axis2_position == "left") {
            echo '$myData->setAxisPosition(2,AXIS_POSITION_LEFT);' . "\r\n";
        } else {
            echo '$myData->setAxisPosition(2,AXIS_POSITION_RIGHT);' . "\r\n";
        }
        echo '$myData->setAxisName(2,"' . $d_axis2_name . '");' . "\r\n";
        echo '$myData->setAxisUnit(2,"' . $d_axis2_unit . '");' . "\r\n\r\n";
    }
}
if ($d_normalize_enabled == "true") {
    if ($Mode == "Render") {
        $myData->normalize(100);
    } else {
        echo '$myData->normalize(100);' . "\r\n";
    }
}
if ($Mode == "Render") {
    if ($g_transparent == "true") {
        $myPicture = new pImage($g_width, $g_height, $myData, TRUE);
    } else {
        $myPicture = new pImage($g_width, $g_height, $myData);
    }
} else {
    $myPicture = new pImage($g_width, $g_height, $myData);
    if ($g_transparent == "true") {
        echo '$myPicture = new pImage(' . $g_width . ',' . $g_height . ',$myData,TRUE);' . "\r\n";
    } else {
开发者ID:ambagasdowa,项目名称:projections,代码行数:31,代码来源:render.php


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