本文整理汇总了PHP中pData::setSerieOnAxis方法的典型用法代码示例。如果您正苦于以下问题:PHP pData::setSerieOnAxis方法的具体用法?PHP pData::setSerieOnAxis怎么用?PHP pData::setSerieOnAxis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pData
的用法示例。
在下文中一共展示了pData::setSerieOnAxis方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pData
<?php
/* CAT:Scaling */
/* 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(24, -25, 26, 25, 25), "Temperature");
$MyData->addPoints(array(1, 2, VOID, 9, 10), "Humidity 1");
$MyData->addPoints(array(1, VOID, 7, -9, 0), "Humidity 2");
$MyData->addPoints(array(-1, -1, -1, -1, -1), "Humidity 3");
$MyData->addPoints(array(0, 0, 0, 0, 0), "Vide");
$MyData->setSerieOnAxis("Temperature", 0);
$MyData->setSerieOnAxis("Humidity 1", 1);
$MyData->setSerieOnAxis("Humidity 2", 1);
$MyData->setSerieOnAxis("Humidity 3", 1);
$MyData->setSerieOnAxis("Vide", 2);
$MyData->setAxisPosition(2, AXIS_POSITION_RIGHT);
$MyData->setAxisName(0, "Temperature");
$MyData->setAxisName(1, "Humidity");
$MyData->setAxisName(2, "Empty value");
/* Create the abscissa serie */
$MyData->addPoints(array("Jan", "Feb", "Mar", "Apr", "May", "Jun"), "Labels");
$MyData->setSerieDescription("Labels", "My labels");
$MyData->setAbscissa("Labels");
/* Create the pChart object */
$myPicture = new pImage(700, 230, $MyData);
/* Draw the background */
$Settings = array("R" => 170, "G" => 183, "B" => 87, "Dash" => 1, "DashR" => 190, "DashG" => 203, "DashB" => 107);
开发者ID:Esleelkartea,项目名称:herramienta_para_autodiagnostico_ADEADA,代码行数:31,代码来源:example.drawScale.multiple.php
示例2: in
$query = "\n\t\t\tSELECT `PlayersJoinedServer`, `PlayersLeftServer`\n\t\t\tFROM `tbl_mapstats`\n\t\t\tWHERE `ServerID` in ({$ids})\n\t\t\tORDER BY `TimeRoundStarted` DESC\n\t\t\tLIMIT {$limit}\n\t\t";
$result = @mysqli_query($BF4stats, $query);
}
if ($result) {
$i = 1;
while ($row = mysqli_fetch_assoc($result)) {
$rounds[$i] = $i;
$joins[] = $row['PlayersJoinedServer'];
$leaves[] = $row['PlayersLeftServer'];
$i++;
}
}
$myData = new pData();
$myData->addPoints($joins, "Serie1");
$myData->setSerieDescription("Serie1", "Joins");
$myData->setSerieOnAxis("Serie1", 0);
$myData->addPoints($leaves, "Serie2");
$myData->setSerieDescription("Serie2", "Leaves");
$myData->setSerieOnAxis("Serie2", 0);
$myData->addPoints($rounds, "Absissa");
$myData->setAbscissa("Absissa");
$myData->setAxisPosition(0, AXIS_POSITION_LEFT);
$myData->setAxisName(0, "Players");
$myData->setAxisUnit(0, "");
$myPicture = new pImage(600, 300, $myData, TRUE);
$myPicture->setFontProperties(array("FontName" => "../pchart/fonts/Forgotte.ttf", "FontSize" => 12));
$TextSettings = array("Align" => TEXT_ALIGN_MIDDLEMIDDLE, "R" => 150, "G" => 150, "B" => 150);
// if so, this is a server stats page
if (!empty($sid)) {
$myPicture->drawText(297, 18, "Joins and leaves of this server in last " . $limit . " rounds.", $TextSettings);
} else {
示例3: columnChart
/**
*
* @param array $data
* @param string $title
* @return resource
*/
public static function columnChart(array $data, $title, $scaleConfig = array(), $legendConfig = array())
{
$fontsChart = APPLICATION_PATH . '/../library/pChart/fonts/verdana.ttf';
App_Util_Chart::loadClass(array('pData', 'pDraw', 'pImage'));
$myData = new pData();
foreach ($data['series'] as $c => $serie) {
$serieId = 'Serie' . $c;
$myData->addPoints($serie, $serieId);
$myData->setSerieDescription($serieId, $data['names'][$c]);
$myData->setSerieOnAxis($serieId, 0);
}
$myData->addPoints($data['labels'], 'Absissa');
$myData->setAbscissa('Absissa');
$myData->setAxisPosition(0, AXIS_POSITION_LEFT);
$myPicture = new pImage(700, 500, $myData);
$Settings = array("R" => 250, "G" => 250, "B" => 250);
$myPicture->drawFilledRectangle(0, 0, self::$_width, self::$_height, $Settings);
$myPicture->drawRectangle(0, 0, self::$_width - 1, self::$_height - 1, array("R" => 0, "G" => 0, "B" => 0));
$myPicture->setFontProperties(array("FontName" => $fontsChart . "verdana.ttf", "FontSize" => 14));
$myPicture->setGraphArea(50, 50, self::$_width - 1, self::$_height - 100);
$myPicture->setFontProperties(array("R" => 0, "G" => 0, "B" => 0, "FontName" => $fontsChart, "FontSize" => 10));
$Settings = array("Pos" => SCALE_POS_LEFTRIGHT, "Mode" => SCALE_MODE_START0, "LabelingMethod" => LABELING_ALL, "GridR" => 255, "GridG" => 255, "GridB" => 255, "GridAlpha" => 50, "TickR" => 0, "TickG" => 0, "TickB" => 0, "TickAlpha" => 50, "CycleBackground" => 1, "LabelRotation" => 45, "DrawXLines" => 1, "DrawSubTicks" => 1, "SubTickR" => 255, "SubTickG" => 0, "SubTickB" => 0, "SubTickAlpha" => 50, "DrawYLines" => ALL);
foreach ($scaleConfig as $c => $v) {
$Settings[$c] = $v;
}
$myPicture->drawScale($Settings);
$Config = array("DisplayValues" => 1, "AroundZero" => 1, "Gradient" => TRUE, "GradientMode" => GRADIENT_EFFECT_CAN);
$myPicture->drawBarChart($Config);
$pos = floor(strlen($title) / 2);
$start = 350 - $pos * 9;
$myPicture->setFontProperties(array('FontName' => $fontsChart, 'FontSize' => 14));
$myPicture->drawText($start, 25, $title, array('R' => 0, 'G' => 0, 'B' => 0));
$Config = array("FontR" => 0, "FontG" => 0, "FontB" => 0, "FontName" => $fontsChart, "FontSize" => 8, "Margin" => 6, "Alpha" => 30, "BoxSize" => 5, "Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL);
foreach ($legendConfig as $c => $v) {
$Config[$c] = $v;
}
$myPicture->drawLegend(480, 40, $Config);
ob_start();
imagepng($myPicture->Picture);
$image = ob_get_clean();
return $image;
}
示例4: pData
/* pChart library inclusions */
include "../class/pData.class.php";
include "../class/pDraw.class.php";
include "../class/pImage.class.php";
include "../class/pScatter.class.php";
/* Create the pData object */
$myData = new pData();
/* Create the X axis and the binded series */
$myData->addPoints(array(3, 12, 15, 8, 5, -5), "X Values");
$myData->setAxisName(0, "X Values");
$myData->setAxisXY(0, AXIS_X);
$myData->setAxisDisplay(0, AXIS_FORMAT_TIME, "i:s");
$myData->setAxisPosition(0, AXIS_POSITION_BOTTOM);
/* Create the Y axis and the binded series */
$myData->addPoints(array(2, 7, 5, 18, 19, 22), "Y Values");
$myData->setSerieOnAxis("Y Values", 1);
$myData->setAxisName(1, "Y Values");
$myData->setAxisXY(1, AXIS_Y);
/* Create the pChart object */
$myPicture = new pImage(400, 400, $myData);
/* Draw the background */
$Settings = array("R" => 170, "G" => 183, "B" => 87, "Dash" => 1, "DashR" => 190, "DashG" => 203, "DashB" => 107);
$myPicture->drawFilledRectangle(0, 0, 400, 400, $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, 400, 400, DIRECTION_VERTICAL, $Settings);
$myPicture->drawGradientArea(0, 0, 400, 20, DIRECTION_VERTICAL, array("StartR" => 0, "StartG" => 0, "StartB" => 0, "EndR" => 50, "EndG" => 50, "EndB" => 50, "Alpha" => 80));
/* Write the picture title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Silkscreen.ttf", "FontSize" => 6));
$myPicture->drawText(10, 13, "drawScatterScale() - Draw the scatter chart scale", array("R" => 255, "G" => 255, "B" => 255));
/* Add a border to the picture */
示例5: makeChartArticle
static function makeChartArticle($type, $data, $events, $colors, $lang = "en")
{
global $wt, $I18N;
$font = PCHART_FONTS_PATH . "/LiberationSans-Regular.ttf";
if (in_array($wt->uselang, array("zh", "ja", "jp", "ko"))) {
$font = PCHART_FONTS_PATH . "/wqy-microhei.ttf";
}
if (in_array($wt->uselang, array("he", "bn", "vi", "fa", "ar", "th", "ta", "ka", "hi", "hy", "ml"))) {
$font = PCHART_FONTS_PATH . "/unifont.ttf";
}
$maxsizeTotal = 0;
$maxeditTotal = 0;
$u = 0;
foreach ($data as $year => $values) {
$years[] = $year;
$all[] = $values["all"];
$minor[] = $values["minor"];
$anon[] = $values["anon"];
$maxsize = 0;
//get the max size of each month
foreach ($values["months"] as $i => $mdetails) {
if ($mdetails["size"] > $maxsize) {
$maxsize = $mdetails["size"];
}
}
$tmpssize[] = $maxsize ? $maxsize : $tmpssize[$u - 1];
$linemarker[] = 1;
$eventmarker[] = isset($events[$year]["protect"]) ? 10 + $events[$year]["protect"] * 3 : 0;
$u++;
}
$msgAll = $I18N->msg('all');
$msgMinor = $I18N->msg('minor');
$msgPagesize = $I18N->msg('pagesize');
$MyData = new pData();
$MyData->addPoints($all, "all");
$MyData->addPoints($minor, "minor");
$MyData->addPoints($anon, "anon");
$MyData->addPoints($tmpssize, "size");
$MyData->addPoints($eventmarker, "protect");
$MyData->setSerieOnAxis("all", 0);
$MyData->setSerieOnAxis("minor", 0);
$MyData->setSerieOnAxis("anon", 0);
$MyData->setSerieOnAxis("size", 1);
$MyData->setSerieOnAxis("protect", 1);
$MyData->setAxisPosition(1, AXIS_POSITION_RIGHT);
$MyData->setAxisName(0, "Edits");
$MyData->setAxisName(1, "Size (kb)");
$MyData->Data["Series"]["all"]["Color"] = self::hex2rgb($colors["all"], 200, true);
$MyData->Data["Series"]["minor"]["Color"] = self::hex2rgb($colors["minor"], 200, true);
$MyData->Data["Series"]["anon"]["Color"] = self::hex2rgb($colors["anon"], 200, true);
$MyData->Data["Series"]["size"]["Color"] = self::hex2rgb($colors["size"], 200, true);
$MyData->Data["Series"]["protect"]["Color"] = self::hex2rgb($colors["protect"], 200, true);
$MyData->addPoints($years, "Labels");
$MyData->setAbscissa("Labels");
$myPicture = new pImage(1000, 300, $MyData, TRUE);
$myPicture->setFontProperties(array("FontName" => $font, "FontSize" => 12, "R" => 34, "G" => 34, "B" => 34));
$myPicture->setGraphArea(50, 30, 820, 270);
$myPicture->setFontProperties(array("FontName" => $font, "FontSize" => 8));
$scaleSettings = array("AxisR" => 134, "AxisG" => 134, "AxisB" => 134, "AxisAplha" => 40, "DrawSubTicks" => TRUE, "CycleBackground" => false, "LabelRotation" => 0, "LabelSkip" => 0, "Mode" => SCALE_MODE_START0);
$myPicture->drawScale($scaleSettings);
$settings = array("Surrounding" => -30, "InnerSurrounding" => 10, "RecordImageMap" => false, "DisplayValues" => false);
$MyData->setSerieDrawable('size', false);
$MyData->setSerieDrawable('protect', false);
$myPicture->drawBarChart($settings);
$MyData->setSerieDrawable('size', true);
$MyData->setSerieDrawable('all', false);
$MyData->setSerieDrawable('minor', false);
$MyData->setSerieDrawable('anon', false);
$MyData->setSerieDrawable('protect', false);
$myPicture->drawLineChart();
$MyData->setSerieDrawable('protect', true);
$MyData->setSerieDrawable('size', true);
$myBubbleChart = new pBubble($myPicture, $MyData);
$bubbleDataSeries = array("size");
$bubbleWeightSeries = array("protect");
$myBubbleChart->bubbleScale($bubbleDataSeries, $bubbleWeightSeries);
$myBubbleChart->drawBubbleChart($bubbleDataSeries, $bubbleWeightSeries, array("ForceAlpha" => true));
$myPicture->setFontProperties(array("FontName" => $font, "FontSize" => 11, "R" => 34, "G" => 34, "B" => 34));
$MyData->setSerieDrawable('size', true);
$MyData->setSerieDrawable('all', true);
$MyData->setSerieDrawable('minor', true);
$MyData->setSerieDrawable('anon', true);
$MyData->setSerieDrawable('protect', true);
$myPicture->drawLegend(900, 55, array("Style" => LEGEND_NOBORDER, "BoxWidth" => 10, "BoxHeight" => 10, "Mode" => LEGEND_VERTICAL));
ob_start();
imagepng($myPicture->Picture);
$imgdata = ob_get_contents();
ob_end_clean();
$rimg = "data:image/png;base64," . base64_encode($imgdata);
return $rimg;
}
示例6: block_mystats_quiz_chart
function block_mystats_quiz_chart($avg, $high, $strAvg, $strHigh, $strTitle, $strScale, $userid)
{
$myQuizData = new pData();
$myQuizData->addPoints(array($avg), "Serie1");
$myQuizData->setSerieDescription("Serie1", $strAvg);
$myQuizData->setSerieOnAxis("Serie1", 0);
$myQuizData->addPoints(array($high), "Serie2");
$myQuizData->setSerieDescription("Serie2", $strHigh);
$myQuizData->setSerieOnAxis("Serie2", 0);
$myQuizData->addPoints(array(" "), "Absissa");
$myQuizData->setAbscissa("Absissa");
$myQuizData->setAxisPosition(0, AXIS_POSITION_LEFT);
$myQuizData->setAxisName(0, $strScale);
$myQuizData->setAxisUnit(0, "");
$myQuizPicture = new pImage(350, 230, $myQuizData);
$quizSettings = array("R" => 255, "G" => 255, "B" => 255);
$myQuizPicture->drawFilledRectangle(0, 0, 350, 230, $quizSettings);
$myQuizPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 50, "G" => 50, "B" => 50, "Alpha" => 20));
$myQuizPicture->setFontProperties(array("FontName" => "../blocks/mystats/pChart2.1.3/fonts/GeosansLight.ttf", "FontSize" => 14));
$TextSettings = array("Align" => TEXT_ALIGN_TOPLEFT, "R" => 0, "G" => 0, "B" => 0);
$myQuizPicture->drawText(25, 25, $strTitle, $TextSettings);
$myQuizPicture->setShadow(FALSE);
$myQuizPicture->setGraphArea(25, 70, 325, 210);
$myQuizPicture->setFontProperties(array("R" => 0, "G" => 0, "B" => 0, "FontName" => "../blocks/mystats/pChart2.1.3/fonts/pf_arma_five.ttf", "FontSize" => 8));
$AxisBoundaries = array(0 => array("Min" => 0, "Max" => 110), 1 => array("Min" => 00, "Max" => 1));
$quizSettings = array("Pos" => SCALE_POS_TOPBOTTOM, "Mode" => SCALE_MODE_MANUAL, "ManualScale" => $AxisBoundaries, "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);
$myQuizPicture->drawScale($quizSettings);
$myQuizPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 50, "G" => 50, "B" => 50, "Alpha" => 10));
$quizConfig = array("DisplayValues" => 1, "Rounded" => 1, "AroundZero" => 1);
$myQuizPicture->drawBarChart($quizConfig);
$quizConfig = array("R" => 0, "G" => 0, "B" => 0, "Alpha" => 50, "AxisID" => 0, "Ticks" => 4, "Caption" => "Threshold");
$myQuizPicture->drawThreshold(0, $quizConfig);
$quizConfig = array("FontR" => 0, "FontG" => 0, "FontB" => 0, "FontName" => "../blocks/mystats/pChart2.1.3/fonts/pf_arma_five.ttf", "FontSize" => 8, "Margin" => 6, "Alpha" => 30, "BoxSize" => 5, "Style" => LEGEND_ROUND, "Mode" => LEGEND_VERTICAL, "Family" => LEGEND_FAMILY_CIRCLE);
$myQuizPicture->drawLegend(240, 16, $quizConfig);
$imgName = sha1($userid . $strTitle) . '.png';
$myQuizPicture->Render('../blocks/mystats/img/' . $imgName);
return '<img src="../blocks/mystats/img/' . $imgName . '" alt="' . $strAvg . ': ' . $avg . ', ' . $strHigh . ': ' . $high . '">';
}
示例7: pData
$myData = new pData();
/* Define all the data series */
$myData->addPoints(array(10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5), "X1");
$myData->addPoints(array(8.039999999999999, 6.95, 7.58, 8.81, 8.33, 9.960000000000001, 7.24, 4.26, 10.84, 4.82, 5.68), "Y1");
$myData->addPoints(array(10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5), "X2");
$myData->addPoints(array(9.140000000000001, 8.140000000000001, 8.74, 8.77, 9.26, 8.1, 6.13, 3.1, 9.130000000000001, 7.26, 4.74), "Y2");
$myData->addPoints(array(10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5), "X3");
$myData->addPoints(array(7.46, 6.77, 12.74, 7.11, 7.81, 8.84, 6.08, 5.39, 8.15, 6.42, 5.73), "Y3");
$myData->addPoints(array(8, 8, 8, 8, 8, 8, 8, 19, 8, 8, 8), "X4");
$myData->addPoints(array(6.58, 5.76, 7.71, 8.84, 8.470000000000001, 7.04, 5.25, 12.5, 5.56, 7.91, 6.89), "Y4");
/* Create the X axis */
$myData->setAxisName(0, "X");
$myData->setAxisXY(0, AXIS_X);
$myData->setAxisPosition(0, AXIS_POSITION_BOTTOM);
/* Create the Y axis */
$myData->setSerieOnAxis("Y1", 1);
$myData->setSerieOnAxis("Y2", 1);
$myData->setSerieOnAxis("Y3", 1);
$myData->setSerieOnAxis("Y4", 1);
$myData->setAxisName(1, "Y");
$myData->setAxisXY(1, AXIS_Y);
$myData->setAxisPosition(1, AXIS_POSITION_LEFT);
/* Create the scatter chart binding */
$myData->setScatterSerie("X1", "Y1", 0);
$myData->setScatterSerie("X2", "Y2", 1);
$myData->setScatterSerie("X3", "Y3", 2);
$myData->setScatterSerie("X4", "Y4", 3);
$myData->setScatterSerieDrawable(1, FALSE);
$myData->setScatterSerieDrawable(2, FALSE);
$myData->setScatterSerieDrawable(3, FALSE);
/* Create the pChart object */
示例8: array
$myData->loadPalette("palettes/" . $p_template . ".color", TRUE);
}
$conn = mysqli_connect($servername, $username, $password, $dbname);
$series[] = array();
foreach ($asignaturas as $key => $value) {
$sql = "SELECT Nota FROM notas" . $cursoActivo . " WHERE N_Id_Escolar = {$alumnof} \n AND id_asignatura = '{$value}';";
$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];
}
}
foreach ($series as $key => $value) {
$myData->addPoints($value, $key);
$myData->setSerieDescription($key, $key);
$myData->setSerieOnAxis($key, 0);
}
//$myData->addPoints(array(28,-19,18,4,-2,-31,17,48),"Serie1");
//$myData->setSerieDescription("Serie1","Serie 1");
//$myData->setSerieOnAxis("Serie1",0);
//
//$myData->addPoints(array(-37,37,-38,16,-4,39,29,6),"Serie2");
//$myData->setSerieDescription("Serie2","Serie 2");
//$myData->setSerieOnAxis("Serie2",0);
//
//$myData->addPoints(array(16,46,-32,35,32,-15,40,29),"Serie3");
//$myData->setSerieDescription("Serie3","Serie 3");
//$myData->setSerieOnAxis("Serie3",0);
$myData->setAxisPosition(0, AXIS_POSITION_LEFT);
$myData->setAxisName(0, "Notas");
$myData->setAxisUnit(0, "");
示例9: pData
//ini_set('display_errors', 'On');
//error_reporting(E_ALL);
// phpinfo();
/* pChart library inclusions */
include "../pChart/class/pData.class.php";
include "../pChart/class/pDraw.class.php";
include "../pChart/class/pImage.class.php";
/* Create the pData object with some random values*/
$MyData = new pData();
/* Import the data from a CSV file */
$MyData->importFromCSV("/var/ram/readings.csv", array("GotHeader" => True, "SkipColumns" => array(0)));
$MyData->setPalette("Temperature", array("R" => 0, "G" => 128, "B" => 0));
$MyData->setPalette("CPU-Temp", array("R" => 128, "G" => 0, "B" => 128));
$MyData->setPalette("Pressure", array("R" => 255, "G" => 0, "B" => 0));
$MyData->setSerieOnAxis("Temperature", 0);
$MyData->setSerieOnAxis("CPU-Temp", 1);
$MyData->setSerieOnAxis("Pressure", 2);
$MyData->setAxisName(0, "Temperature");
$MyData->setAxisName(1, "Temperature");
$MyData->setAxisName(2, "Pressure");
$MyData->setAxisPosition(1, AXIS_POSITION_RIGHT);
/* Get latest value before reversing Series for plotting */
$latest = $MyData->Data['Series']['Pressure']['Data'][0];
/* Reverse series so latest value is on the right */
$MyData->reverseSerie("Temperature");
$MyData->reverseSerie("CPU-Temp");
$MyData->reverseSerie("Pressure");
$earliest = $MyData->Data['Series']['Pressure']['Data'][0];
/* Create the chart*/
$myPicture = new pImage(800, 500, $MyData);
示例10: pData
/* CAT:Mathematical */
/* pChart library inclusions */
include "../class/pData.class.php";
include "../class/pDraw.class.php";
include "../class/pImage.class.php";
include "../class/pScatter.class.php";
/* Create the pData object */
$myData = new pData();
/* Create the X axis and the binded series */
$myData->createFunctionSerie("X", "1/z", array("MinX" => -10, "MaxX" => 10, "XStep" => 1));
$myData->setAxisName(0, "x = 1/z");
$myData->setAxisXY(0, AXIS_X);
$myData->setAxisPosition(0, AXIS_POSITION_BOTTOM);
/* Create the Y axis */
$myData->createFunctionSerie("Y", "z", array("MinX" => -10, "MaxX" => 10, "XStep" => 1));
$myData->setSerieOnAxis("Y", 1);
$myData->setAxisName(1, "y = z");
$myData->setAxisXY(1, AXIS_Y);
$myData->setAxisPosition(1, AXIS_POSITION_RIGHT);
/* Create the Y axis */
$myData->createFunctionSerie("Y2", "z*z*z", array("MinX" => -10, "MaxX" => 10, "XStep" => 1));
$myData->setSerieOnAxis("Y2", 2);
$myData->setAxisName(2, "y = z*z*z");
$myData->setAxisXY(2, AXIS_Y);
$myData->setAxisPosition(2, AXIS_POSITION_LEFT);
/* Create the 1st scatter chart binding */
$myData->setScatterSerie("X", "Y", 0);
$myData->setScatterSerieDescription(0, "Pass A");
$myData->setScatterSerieTicks(0, 4);
$myData->setScatterSerieColor(0, array("R" => 0, "G" => 0, "B" => 0));
/* Create the 2nd scatter chart binding */
示例11: stripTail
}
if ($p_template != "default") {
$myData->loadPalette("../../../palettes/" . $p_template . ".color", TRUE);
}
$Axis = "";
if ($d_serie1_enabled == "true") {
$data0 = stripTail($data0);
$Values = preg_split("/!/", right($data0, strlen($data0) - 1));
foreach ($Values as $key => $Value) {
if ($Value == "") {
$Value = VOID;
}
$myData->addPoints($Value, "Serie1");
}
$myData->setSerieDescription("Serie1", $d_serie1_name);
$myData->setSerieOnAxis("Serie1", $d_serie1_axis);
$Axis[$d_serie1_axis] = TRUE;
if ($Mode == "Source") {
$Data = "";
foreach ($Values as $key => $Value) {
if ($Value == "" || $Value == VOID) {
$Value = "VOID";
}
$Data = $Data . "," . toString($Value);
}
$Data = right($Data, strlen($Data) - 1);
echo '$myData->addPoints(array(' . $Data . '),"Serie1");' . "\r\n";
echo '$myData->setSerieDescription("Serie1","' . $d_serie1_name . '");' . "\r\n";
echo '$myData->setSerieOnAxis("Serie1",' . $d_serie1_axis . ');' . "\r\n\r\n";
$Axis[$d_serie1_axis] = TRUE;
}
示例12: pData
<?php
include "statistics_delivery_areas.php";
include "statistics_series_total_sum.php";
include "pChart/class/pData.class.php";
include "pChart/class/pDraw.class.php";
include "pChart/class/pImage.class.php";
include "statistics_description_text.php";
$pChart = new pData();
$width = 260;
$height = 500;
$pChart->addPoints(array($result_00_10[0], $result_11_14[0], $result_15_19[0], $result_20_27[0], $result_22100_22950[0], $result_28_29[0], $result_30_32[0], $result_33_39[0], $result_40_44[0], $result_45_47[0], $result_48_49[0], $result_50_52[0], $result_53_56[0], $result_57_59[0], $result_60_64[0], $result_65_66[0], $result_67_69[0], $result_70_75[0], $result_76_79[0], $result_80_83[0], $result_84_86[0], $result_87_89[0], $result_90_93[0], $result_94_95[0], $result_96_99[0]), "Serie1");
$pChart->setSerieDescription("Serie1", "Serie 1");
$pChart->setSerieOnAxis("Serie1", 0);
$pChart->addPoints(array("00-10", "11-14", "15-19", "20-27", "22-23", "28-29", "30-32", "33-39", "40-44", "45-47", "48-49", "50-52", "53-56", "57-59", "60-64", "65-66", "67-69", "70-75", "76-79", "80-83", "84-86", "87-89", "90-93", "94-95", "96-99"), "Absissa");
$pChart->setAbscissa("Absissa");
$pChart->setAxisPosition(0, AXIS_POSITION_LEFT);
$pChart->setAxisName(0, "Kappalemäärä / postinumeroalue");
$pChart->setAxisUnit(0, "");
$pChartPicture = new pImage($width, $height, $pChart);
$Settings = array("R" => 255, "G" => 255, "B" => 255);
$pChartPicture->drawFilledRectangle(0, 0, 250, 470, $Settings);
$pChartPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 50, "G" => 50, "B" => 50, "Alpha" => 20));
$pChartPicture->setFontProperties(array("FontName" => "pChart/fonts/arial.ttf", "FontSize" => 14));
$TextSettings = array("Align" => TEXT_ALIGN_TOPMIDDLE, "R" => 0, "G" => 0, "B" => 0);
$pChartPicture->drawText($width / 2, 5, ucfirst($table) . " /", $TextSettings);
$pChartPicture->drawText($width / 2, 22, "postinumeroalue", $TextSettings);
$description_years = GetYearsDescription($years);
$description_sum = "(" . GetSeriesTotalSum($pChart) . " kpl)";
if (strlen($description) > 48) {
$description = substr($description, strpos($description, "joissa"));
示例13: electrique_mois
function electrique_mois()
{
//initialisation des variables tableau
$timestamp = "";
$conso = "";
$sql = mysql_query("SELECT TIMESTAMP(CONCAT(YEAR(date_histo ),'-',MONTH(date_histo ),'-',DAY(date_histo ),' ',HOUR(date_histo ),':00')),\n\t\t\t\t\tdate_histo, AVG(valeur1),MAX(valeur1),MIN(valeur1)\n\t\t\t\t\tFROM historique_donnees\n\t\t\t\t\tWHERE id_objet = 2\n\t\t\t\t\tAND date_histo > DATE_SUB(NOW( ), INTERVAL 31 DAY)\n\t\t\t\t\tGROUP BY YEAR( date_histo ) , MONTH( date_histo ) , DAY( date_histo ), HOUR( date_histo ), id_objet\n\t\t\t\t\tHAVING HOUR( date_histo ) IN ( 00, 06, 12, 18 ) \n\t\t\t\t\tORDER BY date_histo");
while (list($date_histo, $date_histo2, $conso_sql, $conso_sql_max, $conso_sql_min) = mysql_fetch_array($sql)) {
$timestamp[] = strtotime($date_histo);
$conso[] = $conso_sql;
$conso_max[] = $conso_sql_max;
$conso_min[] = $conso_sql_min;
}
$myData = new pData();
$myData->addPoints($timestamp, "Timestamp");
$myData->addPoints($conso, "Consommation Instantanée Moyenne");
$myData->addPoints($conso_max, "Conso. Inst. Max");
$myData->addPoints($conso_min, "Conso. Inst. Min");
$myData->setSerieOnAxis("Consommation Instantanée", 0);
$myData->setSerieOnAxis("Conso. Inst. Max", 0);
$myData->setSerieOnAxis("Conso. Inst. Min", 0);
$myData->setAbscissa("Timestamp");
$myData->setXAxisName("Time");
$myData->setXAxisDisplay(AXIS_FORMAT_TIME, "d/m");
$myData->setAxisName(0, "Consommation Instantanée");
$myData->setAxisUnit(0, "W");
$myPicture = new pImage(1250, 550, $myData);
$Settings = array("StartR" => 48, "StartG" => 124, "StartB" => 183, "EndR" => 33, "EndG" => 86, "EndB" => 128, "Alpha" => 50);
$myPicture->drawGradientArea(0, 0, 1250, 550, DIRECTION_VERTICAL, $Settings);
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 50, "G" => 50, "B" => 50, "Alpha" => 20));
$myPicture->setFontProperties(array("FontName" => "fonts/Forgotte.ttf", "FontSize" => 18));
$TextSettings = array("Align" => TEXT_ALIGN_MIDDLEMIDDLE, "R" => 255, "G" => 255, "B" => 255);
$myPicture->drawText(350, 25, "Consommation éléctrique", $TextSettings);
$myPicture->setShadow(FALSE);
$myPicture->setGraphArea(110, 50, 1160, 500);
$myPicture->setFontProperties(array("R" => 0, "G" => 0, "B" => 0, "FontName" => "fonts/Forgotte.ttf", "FontSize" => 14));
$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" => 45, "CycleBackground" => 1, "DrawXLines" => 1, "DrawSubTicks" => 1, "SubTickR" => 255, "SubTickG" => 0, "SubTickB" => 0, "SubTickAlpha" => 50, "DrawYLines" => ALL, "LabelSkip" => 3);
$myPicture->drawScale($Settings);
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 50, "G" => 50, "B" => 50, "Alpha" => 10));
$Config = "";
$myPicture->drawSplineChart($Config);
$Config = array("FontR" => 0, "FontG" => 0, "FontB" => 0, "FontName" => "fonts/Forgotte.ttf", "FontSize" => 14, "Margin" => 6, "Alpha" => 30, "BoxSize" => 5, "Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL);
$myPicture->drawLegend(563, 16, $Config);
$myPicture->render("tmp/graphe_em.png");
echo "<img src='tmp/graphe_em.png' alt='graphe'/>";
}
示例14: min
$myData->setSerieWeight($field, $weight);
if ($plotShape >= 0 and $plotShape < count($plotShapes)) {
$myData->setSerieShape($field, $plotShapes[$plotShape]);
} else {
$myData->setSerieShape($field, $plotShapes[array_rand($plotShapes, 1)]);
}
if (isset($palette)) {
$myData->setPalette($field, $palette['serie'][($nSerie - 1) % $palette['serie_num']]);
}
if ($nSerie == 0) {
$abscissa = $field;
$myData->setAbscissa($abscissa);
} else {
if (isset($chart_cols2) and in_array($idx, $chart_cols2)) {
$arrSeriesY2[] = $field;
$myData->setSerieOnAxis($field, 1);
$myData->setSerieDescription($field, "右){$field}");
}
}
$nSerie += 1;
}
}
if (isset($arrSeriesY2)) {
$myData->setAxisPosition(1, AXIS_POSITION_RIGHT);
}
$myData->setAxisUnit(0, $unitY);
/* Write the chart legend */
$sizeLegend = $myPicture->getLegendSize(array("Mode" => LEGEND_VERTICAL));
$widthLegend = min($sizeLegend['Width'], max(120, $width * 0.25));
if ($legend > 0) {
$myPicture->setFontProperties(array("FontName" => "./fonts/simsun.ttc", "FontSize" => $font, "R" => 0, "G" => 0, "B" => 0));
示例15: pData
include "statistics_tile_and_colour.php";
include "statistics_series_total_sum.php";
include "statistics_description_years.php";
include "pChart/class/pData.class.php";
include "pChart/class/pDraw.class.php";
include "pChart/class/pImage.class.php";
include "statistics_description_text.php";
$width = 760;
$height = 500;
$pChart = new pData();
$chart_tile_colours = array("0" => array("R" => 246, "G" => 113, "B" => 53, "Alpha" => 100), "1" => array("R" => 211, "G" => 60, "B" => 29, "Alpha" => 100), "2" => array("R" => 80, "G" => 94, "B" => 97, "Alpha" => 100), "3" => array("R" => 131, "G" => 137, "B" => 129, "Alpha" => 100), "4" => array("R" => 42, "G" => 43, "B" => 45, "Alpha" => 100), "5" => array("R" => 116, "G" => 82, "B" => 73, "Alpha" => 100), "6" => array("R" => 190, "G" => 93, "B" => 72, "Alpha" => 100), "7" => array("R" => 95, "G" => 83, "B" => 84, "Alpha" => 100), "8" => array("R" => 220, "G" => 220, "B" => 220, "Alpha" => 100));
for ($i = 0; $i < count($colours); $i++) {
$pChart->addPoints(array($tile_colour_results[0][$i], $tile_colour_results[1][$i], $tile_colour_results[2][$i], $tile_colour_results[3][$i], $tile_colour_results[4][$i], $tile_colour_results[5][$i], $tile_colour_results[6][$i], $tile_colour_results[7][$i], $tile_colour_results[8][$i], $tile_colour_results[9][$i], $tile_colour_results[10][$i], $tile_colour_results[11][$i], $tile_colour_results[12][$i]), "Serie{$i}");
$pChart->setSerieDescription("Serie{$i}", $colours[$i][0]);
$pChart->setSerieOnAxis("Serie{$i}", 0);
$pChart->setPalette("Serie{$i}", $chart_tile_colours[$i]);
}
$pChart->addPoints(array(get_tile_total_count($tile_colour_results, 0), get_tile_total_count($tile_colour_results, 1), get_tile_total_count($tile_colour_results, 2), get_tile_total_count($tile_colour_results, 3), get_tile_total_count($tile_colour_results, 4), get_tile_total_count($tile_colour_results, 5), get_tile_total_count($tile_colour_results, 6), get_tile_total_count($tile_colour_results, 7), get_tile_total_count($tile_colour_results, 8), get_tile_total_count($tile_colour_results, 9), get_tile_total_count($tile_colour_results, 10), get_tile_total_count($tile_colour_results, 11), get_tile_total_count($tile_colour_results, 12)), "Serie10");
$pChart->setSerieDrawable("Serie10", FALSE);
$pChart->setPalette("Serie10", array("Alpha" => 0));
$pChart->addPoints(array("Ormax", "Protector", "Polar", "Minster", "Turmalin", "Granat", "E13", "T11", "Nova", "Rubin", "Nortegl", "Hollander", "KDN"), "Absissa");
$pChart->setAbscissa("Absissa");
$pChart->setAxisPosition(0, AXIS_POSITION_LEFT);
$pChart->setAxisName(0, "Laskentamäärät kpl");
$pChart->setAxisUnit(0, "");
$pChartPicture = new pImage($width, $height, $pChart);
$Settings = array("R" => 255, "G" => 255, "B" => 255);
$pChartPicture->drawFilledRectangle(0, 0, $width, $height, $Settings);
$pChartPicture->setFontProperties(array("FontName" => "pChart/fonts/arial.ttf", "FontSize" => 14));
$TextSettings = array("Align" => TEXT_ALIGN_BOTTOMMIDDLE, "R" => 0, "G" => 0, "B" => 0);