• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Plot类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: RenderWikiPlot

/**
*RenderWikiPlot CallBack function
*
*This is the function that handles MediaWiki callbacks, and renders the actual plot.
*
*@access private
*@param string $input The content of the wikiplot tag
*@param array $argv Hash-array of the parameters of the wikiplot tag, with parameter-name as key and parameter-value as value.
*@param Parser $parser The parser of MediaWiki, if null parser is obtained from global variable
*@uses WikiPlotDeserializeBoolean()
*@uses WikiPlotDeserializeString()
*@uses WikiPlotDeserializeMixed()
*@uses WikiPlotDeserializeInteger()
*@uses WikiPlotDeserializeColor()
*@uses XMLParser
*@uses Plot
*@uses Graph
*@uses Cache
*@return string HTML that can be directly inserted into any website.
*/
function RenderWikiPlot($input, $argv, $parser = null)
{
    //Get parser if not given as parameter
    if (!$parser) {
        $parser =& $GLOBALS['wgParser'];
    }
    /*Currently the parser*/
    //Creating instance of plot
    $Plot = new Plot();
    //Getting and deserializing parameters
    WikiPlotDeserializeBoolean($argv["grid"], $Plot->EnableGrid);
    WikiPlotDeserializeBoolean($argv["axis"], $Plot->EnableAxis);
    WikiPlotDeserializeString($argv["caption"], $Plot->Caption);
    WikiPlotDeserializeMixed($argv["xspan"], $Plot->MinX, $Plot->MaxX);
    WikiPlotDeserializeMixed($argv["yspan"], $Plot->MinY, $Plot->MaxY);
    WikiPlotDeserializeMixed($argv["gridspace"], $Plot->XGridSpace, $Plot->YGridSpace);
    WikiPlotDeserializeInteger($argv["height"], $Plot->Height);
    WikiPlotDeserializeInteger($argv["width"], $Plot->Width);
    WikiPlotDeserializeInteger($argv["captionfont"], $Plot->CaptionFont);
    WikiPlotDeserializeInteger($argv["gridfont"], $Plot->GridFont);
    WikiPlotDeserializeColor($argv["gridcolor"], $Plot->GridColor);
    //Parsing Xml
    $XmlParser = new XMLParser($input);
    $Graphs = $XmlParser->CreateInputArray();
    foreach ($Graphs as $Graph) {
        $G = new Graph();
        if (!is_array($Graph[1])) {
            $G->Exp = $Graph[1];
            WikiPlotDeserializeString($Graph[0]["label"], $G->Label);
            WikiPlotDeserializeColor($Graph[0]["color"], $G->Color);
        } else {
            $G->Exp = $Graph[0];
        }
        array_push($Plot->Graphs, $G);
    }
    //Render the plot
    //Get instance of cache
    $cache = new cache();
    //Url of the current plot
    $PlotURL = "";
    $PlotFileName = $Plot->GetHash() . ".png";
    if (!$cache->FileExist($PlotFileName)) {
        $Plot->SaveAs($cache->CachePath($PlotFileName));
    } else {
        $PlotURL = $cache->FileURL($PlotFileName);
    }
    $output = "<a href='{$PlotURL}' class='image' title='See the plot'><img src='{$PlotURL}'></a>";
    return $output;
}
开发者ID:mediawiki-extensions,项目名称:wikiplot,代码行数:69,代码来源:WikiPlot.php


示例2: UNIX_TIMESTAMP

$Query = '
	SELECT
		time*1000 as time,
		DAYOFYEAR(FROM_UNIXTIME(`time`)) as `d`,
		AVG(`temperature`) as `temp`
	FROM `' . PREFIX . 'training`
	WHERE
		!ISNULL(`temperature`) AND
		`time` BETWEEN UNIX_TIMESTAMP(\'' . (int) $Year . '-01-01\') AND UNIX_TIMESTAMP(\'' . ((int) $Year + 1) . '-01-01\')-1
	GROUP BY `d`
	ORDER BY `d` ASC';
$Data = DB::getInstance()->query($Query)->fetchAll();
foreach ($Data as $dat) {
    $Temperatures[$dat['time']] = $Temperature->format((int) $dat['temp'], false);
}
$Plot = new Plot("year" . $Year, 780, 240);
$Plot->Data[] = array('label' => __('Temperatures') . ' ' . $Year, 'data' => $Temperatures);
$Plot->setMarginForGrid(5);
$Plot->setXAxisAsTime();
$Plot->setXAxisLimitedTo($Year);
$Plot->addYAxis(1, 'left');
$Plot->addYUnit(1, $Temperature->unit(), 0);
$Plot->setYTicks(1, 5, 0);
$Plot->addThreshold('y', 0);
$Plot->addMarkingArea('y', -99, 0);
$Plot->showPoints(2);
$Plot->smoothing(false);
if (empty($Data)) {
    $Plot->raiseError(__('No data available.'));
}
$Plot->outputJavaScript();
开发者ID:guancio,项目名称:Runalyze,代码行数:31,代码来源:Plot.Year.php


示例3: rand

$iPoints = 15;
$dx = (GRAPH_WIDTH - 40) / ($iPoints - 1);
$x = 20;
for ($i = 0; $i < $iPoints; $i++) {
    $y = rand(20, GRAPH_HEIGHT - 20);
    $aCoords[$x] = $y;
    $x += $dx;
}
$vImagegHeight = GRAPH_HEIGHT + 30;
$vImage = imagecreatetruecolor(GRAPH_WIDTH + 50, $vImagegHeight);
$vBgColor = imagecolorallocate($vImage, 160, 160, 160);
$vTextColor = imagecolorallocate($vImage, 0, 0, 0);
$vAxisColor = imagecolorallocate($vImage, 0, 0, 0);
$vDotColor = imagecolorallocate($vImage, 192, 64, 64);
imagefill($vImage, 0, 0, $vBgColor);
$oPlot = new Plot($aCoords);
$oPlot->drawDots($vImage, $vDotColor, 10, GRAPH_HEIGHT, 8);
$oCurve = new CubicSplines();
$vColor = imagecolorallocate($vImage, 225, 64, 64);
$iStart = microtime(1);
if ($oCurve) {
    $oCurve->setInitCoords($aCoords, 1);
    $r = $oCurve->processCoords();
    if ($r) {
        $curveGraph = new Plot($r);
    } else {
        continue;
    }
} else {
    $curveGraph = $oPlot;
}
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:index.php


示例4: foreach

if (count($Data) == 1) {
    $Data[1] = $Data[0];
}
if (!empty($Data)) {
    foreach ($Data as $D) {
        $Weights[$D['time'] . '000'] = (double) $D['weight'];
        $HRrests[$D['time'] . '000'] = (int) $D['pulse_rest'];
    }
}
$Labels = array_keys($Weights);
foreach ($Labels as $i => &$value) {
    if ($i != 0 && $i != count($Labels) - 1) {
        $value = '';
    }
}
$Plot = new Plot("sportler_weights", 320, 150);
if ($Plugin->Configuration()->value('use_weight')) {
    $Plot->Data[] = array('label' => __('Weight'), 'color' => '#008', 'data' => $Weights);
}
if ($Plugin->Configuration()->value('use_pulse')) {
    $Plot->Data[] = array('label' => __('Resting HR'), 'color' => '#800', 'data' => $HRrests, 'yaxis' => 2);
}
$Plot->setMarginForGrid(5);
$Plot->setXLabels($Labels);
$Plot->setXAxisTimeFormat('%m/%y');
$Plot->setXAxisMaxToToday();
$Plot->Options['xaxis']['labelWidth'] = 50;
//$Plot->Options['xaxis']['tickLength'] = 3;
$Plot->Options['series']['curvedLines']['fit'] = true;
$Plot->addYAxis(1, 'left');
$Plot->addYUnit(1, 'kg', 1);
开发者ID:n0rthface,项目名称:Runalyze,代码行数:31,代码来源:Plot.gewicht.php


示例5: _e

?>
<div class="panel-heading">
	<div class="panel-menu">
		<ul>
			<li class="with-submenu"><span class="link"><?php 
_e('Choose year');
?>
</span><ul class="submenu"><?php 
echo $Submenu;
?>
</ul></li>
		</ul>
	</div>
	<h1><?php 
_e('Temperatures');
?>
</h1>
</div>

<div class="panel-content">
	<?php 
echo Plot::getDivFor('average', 780, 240);
include FRONTEND_PATH . '../plugin/RunalyzePluginStat_Wetter/Plot.Average.php';
?>
</div>
<div class="panel-content">
	<?php 
echo Plot::getDivFor('year' . $_GET['y'], 780, 240);
include FRONTEND_PATH . '../plugin/RunalyzePluginStat_Wetter/Plot.Year.php';
?>
</div>
开发者ID:guancio,项目名称:Runalyze,代码行数:31,代码来源:window.php


示例6: foreach

			WHERE
				`typeid`="' . Configuration::General()->competitionType() . '"
				AND `distance`="' . $distance . '"
			ORDER BY
				`time` ASC')->fetchAll();
        Cache::set('prognosePlotDistanceData' . $distance, $ResultsData, '600');
    }
    foreach ($ResultsData as $dat) {
        if (!isset($WKplugin) || !$WKplugin->isFunCompetition($dat['id'])) {
            $Results[$dat['time'] . '000'] = $dat['s'] * 1000;
        }
    }
} else {
    $DataFailed = true;
}
$Plot = new Plot("formverlauf_" . str_replace('.', '_', $distance), 800, 450);
$Plot->Data[] = array('label' => __('Prognosis'), 'color' => '#880000', 'data' => $Prognosis, 'lines' => array('show' => true), 'points' => array('show' => false));
$Plot->Data[] = array('label' => __('Result'), 'color' => '#000000', 'data' => $Results, 'lines' => array('show' => false), 'points' => array('show' => true), 'curvedLines' => array('apply' => false));
$Plot->setZeroPointsToNull();
$Plot->setMarginForGrid(5);
$Plot->setXAxisAsTime();
$Plot->addYAxis(1, 'left');
if (!empty($Prognosis) && max($Prognosis) > 1000 * 3600) {
    $Plot->setYAxisTimeFormat('%H:%M:%S');
} else {
    $Plot->setYAxisTimeFormat('%M:%S');
}
$Plot->setTitle(__('Prognosis trend') . ' ' . Distance::format($distance));
if ($DataFailed || empty($Data)) {
    $Plot->raiseError(__('No data available.'));
}
开发者ID:guancio,项目名称:Runalyze,代码行数:31,代码来源:Plot.Form.php


示例7: _e

?>
</span><ul class="submenu"><?php 
echo $Submenu;
?>
</ul></li>
		</ul>
	</div>
	<h1><?php 
_e('Prognosis calculator: form trend');
?>
</h1>
</div>

<div class="panel-content">
	<?php 
echo Plot::getDivFor('formverlauf_' . str_replace('.', '_', $distance), 800, 450);
include FRONTEND_PATH . '../plugin/RunalyzePluginPanel_Prognose/Plot.Form.php';
?>

	<p class="info">
		<?php 
_e('The average VDOT value per month is used.');
?>
	</p>

	<p class="info">
		<?php 
_e('The basic endurance adjustment is <strong>not</strong> used for these calculations.');
?>
	</p>
</div>
开发者ID:guancio,项目名称:Runalyze,代码行数:31,代码来源:window.plot.php


示例8: foreach

$timeFormat = '%M:%S';
$competitions = $this->RaceContainer->races($distance);
//$competitions = DB::getInstance()->query('SELECT id,time,s FROM `'.PREFIX.'training` WHERE `typeid`='.Configuration::General()->competitionType().' AND `distance`="'.$distance.'" ORDER BY `time` ASC')->fetchAll();
if (!empty($competitions)) {
    foreach ($competitions as $competition) {
        if (!$this->isFunCompetition($competition['id'])) {
            $Dates[] = $competition['time'];
            $Results[$competition['time'] . '000'] = $competition['s'] * 1000;
            // Attention: timestamp(0) => 1:00:00
        }
    }
    if (!empty($Results) && max($Results) > 3600 * 1000) {
        $timeFormat = '%H:%M:%S';
    }
}
$Plot = new Plot("bestzeit" . $distance * 1000, 480, 190);
$Plot->Data[] = array('label' => $label, 'data' => $Results);
//$Plot->Data[] = array('label' => $trend, 'data' => $Results, 'color' => '#C61D17', 'lines' => array('show' => true), 'curvedLines' => array('apply' => true, 'fit' => true));
//$Plot->Data[] = array('label' => $label, 'data' => $Results, 'color' => '#C61D17', 'points' => array('show' => true), 'curvedLines' => array('apply' => false));
$Plot->setMarginForGrid(5);
$Plot->setXAxisAsTime();
if (count($Results) == 1) {
    $Plot->setXAxisTimeFormat('%d.%m.%y');
}
$Plot->addYAxis(1, 'left');
$Plot->setYAxisAsTime(1);
$Plot->setYAxisTimeFormat($timeFormat, 1);
$Plot->smoothing(false);
$Plot->lineWithPoints();
$Plot->setTitle($titleCenter);
$Plot->outputJavaScript();
开发者ID:n0rthface,项目名称:Runalyze,代码行数:31,代码来源:Plot.Bestzeit.php


示例9: foreach

    $Data[1] = $Data[0];
}
if (!empty($Data)) {
    foreach ($Data as $D) {
        $Adiposes[$D['time'] . '000'] = $D['fat'];
        $Water[$D['time'] . '000'] = $D['water'];
        $Muscles[$D['time'] . '000'] = $D['muscles'];
    }
}
$Labels = array_keys($Water);
foreach ($Labels as $i => &$value) {
    if ($i != 0 && $i != count($Labels) - 1) {
        $value = '';
    }
}
$Plot = new Plot("sportler_analyse", 320, 150);
$Plot->Data[] = array('label' => __('Fat') . '', 'color' => '#800', 'data' => $Adiposes);
$Plot->Data[] = array('label' => __('Water'), 'color' => '#008', 'data' => $Water, 'yaxis' => 2);
$Plot->Data[] = array('label' => __('Muscles'), 'color' => '#080', 'data' => $Muscles, 'yaxis' => 2);
$Plot->setMarginForGrid(5);
//$Plot->hideXLabels();
$Plot->setXLabels($Labels);
$Plot->setXAxisTimeFormat('%m/%y');
$Plot->setXAxisMaxToToday();
$Plot->Options['xaxis']['labelWidth'] = 50;
//$Plot->Options['xaxis']['tickLength'] = 3;
$Plot->Options['yaxis']['autoscaleMargin'] = 0.1;
$Plot->Options['series']['curvedLines']['fit'] = true;
$Plot->PlotOptions['allowSelection'] = false;
$Plot->addYAxis(1, 'left');
$Plot->addYUnit(1, '%', 0);
开发者ID:guancio,项目名称:Runalyze,代码行数:31,代码来源:Plot.analyse.php


示例10: displayPersonalBestsImages

 /**
  * Display all image-links for personal bests
  */
 private function displayPersonalBestsImages()
 {
     $SubLinks = array();
     foreach ($this->PBdistances as $km) {
         $name = (new Distance($km))->stringAuto(true, 1);
         $SubLinks[] = Ajax::flotChange($name, 'bestzeitenFlots', 'bestzeit' . $km * 1000);
     }
     $Links = array(array('tag' => '<a href="#">' . __('Choose distance') . '</a>', 'subs' => $SubLinks));
     echo '<div class="databox" style="float:none;padding:0;width:490px;margin:20px auto;">';
     echo '<div class="panel-heading">';
     echo '<div class="panel-menu">';
     echo Ajax::toolbarNavigation($Links);
     echo '</div>';
     echo '<h1>' . __('Results trend') . '</h1>';
     echo '</div>';
     echo '<div class="panel-content">';
     $display_km = $this->PBdistances[0];
     if (in_array($this->Configuration()->value('main_distance'), $this->PBdistances)) {
         $display_km = $this->Configuration()->value('main_distance');
     }
     echo '<div id="bestzeitenFlots" class="flot-changeable" style="position:relative;width:482px;height:192px;">';
     foreach ($this->PBdistances as $km) {
         echo Plot::getInnerDivFor('bestzeit' . $km * 1000, 480, 190, $km != $display_km);
         $_GET['km'] = $km;
         include 'Plot.Bestzeit.php';
     }
     echo '</div>';
     echo '</div>';
     echo '</div>';
 }
开发者ID:rob-st,项目名称:Runalyze,代码行数:33,代码来源:class.RunalyzePluginStat_Wettkampf.php


示例11: array_slice

        }
        $VDOT_slice = array_slice($VDOTs_raw, $d - $VDOTdays, $VDOTdays);
        $Durations_slice = array_slice($Durations_raw, $d - $VDOTdays, $VDOTdays);
        $VDOT_sum = array_sum($VDOT_slice);
        $Durations_sum = array_sum($Durations_slice);
        if (count($VDOT_slice) != 0 && $Durations_sum != 0) {
            $VDOTs[$index] = Configuration::Data()->vdotFactor() * ($VDOT_sum / $Durations_sum);
        }
        if ($VDOTs_raw[$d]) {
            $VDOTsday[$index] = Configuration::Data()->vdotFactor() * ($VDOTs_raw[$d] / $Durations_raw[$d]);
        }
    }
} else {
    $DataFailed = true;
}
$Plot = new Plot("form" . $_GET['y'], 800, 450);
$Plot->Data[] = array('label' => __('Fitness (CTL)'), 'color' => '#008800', 'data' => $CTLs);
//if (count($ATLs) < $MaxATLPoints)
$Plot->Data[] = array('label' => __('Fatigue (ATL)'), 'color' => '#CC2222', 'data' => $ATLs);
$Plot->Data[] = array('label' => __('avg VDOT'), 'color' => '#000000', 'data' => $VDOTs, 'yaxis' => 2);
$Plot->Data[] = array('label' => 'TRIMP', 'color' => '#5555FF', 'data' => $TRIMPs, 'yaxis' => 3);
$Plot->Data[] = array('label' => __('day VDOT'), 'color' => '#444444', 'data' => $VDOTsday, 'yaxis' => 2);
$Plot->setMarginForGrid(5);
$Plot->setLinesFilled(array(0));
$Plot->setLinesFilled(array(1), 0.3);
$Plot->setXAxisAsTime();
if (!$All && !$lastHalf && !$lastYear) {
    $Plot->setXAxisLimitedTo($Year);
}
$Plot->addYAxis(1, 'left');
$Plot->setYTicks(1, 1);
开发者ID:schoch,项目名称:Runalyze,代码行数:31,代码来源:Plot.Form.php


示例12: display

 /**
  * Output JS 
  */
 public final function display()
 {
     echo Plot::getInnerDivFor($this->getCSSid(), $this->WIDTH, $this->HEIGHT);
     $this->Plot->outputJavaScript();
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:8,代码来源:ActivityPlot.php


示例13: testPlot

 /**
  * Test a plot
  * 
  * Will be displayed instead of the DataBrowser - Only for testing purposes!
  * @param string $includePath 
  * @param string $name
  * @param int $width
  * @param int $height
  */
 public function testPlot($includePath, $name, $width, $height)
 {
     echo '<div id="container"><div id="main"><div id="data-browser" class="panel c"><div class="panel-content">';
     echo Plot::getDivFor($name, $width, $height);
     include FRONTEND_PATH . $includePath;
     echo '</div></div></div></div>';
     exit;
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:17,代码来源:class.Frontend.php


示例14: displayImages

 /**
  * Display the images
  */
 private function displayImages()
 {
     echo '<div style="max-width:750px;margin:0 auto;">';
     echo '<span class="right">';
     echo Plot::getDivFor('weekday', 350, 190);
     echo '</span>';
     echo '<span class="left">';
     echo Plot::getDivFor('daytime', 350, 190);
     echo '</span>';
     echo HTML::clearBreak();
     echo '</div>';
     include FRONTEND_PATH . '../plugin/' . $this->key() . '/Plot.Daytime.php';
     include FRONTEND_PATH . '../plugin/' . $this->key() . '/Plot.Weekday.php';
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:17,代码来源:class.RunalyzePluginStat_Trainingszeiten.php


示例15: __

$link = 'plugin/RunalyzePluginPanel_Rechenspiele/window.plot.php?y=lastyear';
$Submenu .= '<li' . ('lastyear' == $_GET['y'] ? ' class="active"' : '') . '>' . Ajax::window('<a href="' . $link . '">' . __('Last year') . '</a>') . '</li>';
for ($j = date('Y'); $j >= START_YEAR; $j--) {
    $link = 'plugin/RunalyzePluginPanel_Rechenspiele/window.plot.php?y=' . $j;
    $Submenu .= '<li' . ($j == $_GET['y'] ? ' class="active"' : '') . '>' . Ajax::window('<a href="' . $link . '">' . $j . '</a>') . '</li>';
}
?>
<div class="panel-heading">
	<div class="panel-menu">
		<ul>
			<li class="with-submenu"><span class="link"><?php 
_e('Choose year');
?>
</span><ul class="submenu"><?php 
echo $Submenu;
?>
</ul></li>
		</ul>
	</div>
	<h1><?php 
_e('Shape');
?>
</h1>
</div>

<div class="panel-content">
	<?php 
echo Plot::getDivFor('form' . $_GET['y'], 800, 450);
include FRONTEND_PATH . '../plugin/RunalyzePluginPanel_Rechenspiele/Plot.Form.php';
?>
</div>
开发者ID:n0rthface,项目名称:Runalyze,代码行数:31,代码来源:window.plot.php


示例16: header

<?php

/*
This is an example of how plot.class.php could be used. In this example we will draw a graph of the mathematical expression sent via. the GET method.
*/
//Tell the client that this is a binary png file, NOT html.
//This is also why you can't use html in this example.
header("Content-type: image/png");
/*
Include plot.class.php, since we need the file to draw with.
*/
include "plot.class.php";
//Create an instance of Plot
$Plot = new Plot();
//Initialize some fields on the Plot
$Plot->Caption = "Example plot";
//Setting image size
$Plot->Width = 500;
$Plot->Height = 500;
//Setting coordinate space
$Plot->MinX = -250;
$Plot->MaxX = 250;
$Plot->MinY = -250;
$Plot->MaxY = 250;
//Creating an instance of Graph
$G = new Graph();
//Set the expression of the graph to the parameter given via the GET method.
$G->Exp = $_GET["exp"];
//Set the color of the Graph
$G->Color = array(0, 0, 255);
//Set the label of the Graph
开发者ID:mediawiki-extensions,项目名称:wikiplot,代码行数:31,代码来源:On-The-Fly_Plotting.php


示例17: foreach

}
$Query = '
	SELECT
		YEAR(FROM_UNIXTIME(`time`)) as `y`,
		MONTH(FROM_UNIXTIME(`time`)) as `m`,
		AVG(`temperature`) as `temp`
	FROM `' . PREFIX . 'training`
	WHERE
		!ISNULL(`temperature`)
	GROUP BY `y`, `m`
	ORDER BY `y` ASC, `m` ASC';
$Data = DB::getInstance()->query($Query)->fetchAll();
foreach ($Data as $dat) {
    $Temperatures[$dat['y']][$dat['m'] - 1] = (int) $dat['temp'];
}
$Plot = new Plot("average", 780, 240);
for ($y = START_YEAR, $n = date('Y'); $y <= $n; $y++) {
    if (min($Temperatures[$y]) != null || max($Temperatures[$y]) != null) {
        $Plot->Data[] = array('label' => $y, 'data' => $Temperatures[$y]);
    }
}
$Plot->setMarginForGrid(5);
$Plot->setXLabels($Months);
$Plot->addYAxis(1, 'left');
$Plot->addYUnit(1, '°C', 1);
$Plot->setYTicks(1, 5, 0);
$Plot->addThreshold('y', 0);
$Plot->addMarkingArea('y', -99, 0);
$Plot->lineWithPoints();
$Plot->smoothing(false);
$Plot->outputJavaScript();
开发者ID:n0rthface,项目名称:Runalyze,代码行数:31,代码来源:Plot.Average.php


示例18: BY

	WHERE
		`sportid`=:id
		' . $this->getYearDependenceForQuery() . '
	GROUP BY `day`
	ORDER BY ((`day`+6)%7) ASC');
// TODO: Should be possible with one query?
foreach ($Sports as $sport) {
    $id = $sport['name'];
    $yAxis[$id] = array(0, 0, 0, 0, 0, 0, 0);
    $Query->execute(array(':id' => $sport['id']));
    $data = $Query->fetchAll();
    foreach ($data as $dat) {
        $yAxis[$id][($dat['day'] + 6) % 7] = $dat['value'] / 3600;
    }
}
$Plot = new Plot("weekday", 350, 190);
$max = 0;
foreach ($yAxis as $key => $data) {
    $Plot->Data[] = array('label' => $key, 'data' => $data);
    $max += max($data);
}
$Plot->setLegendAsTable();
$Plot->setMarginForGrid(5);
$Plot->setXLabels($xAxis);
$Plot->addYAxis(1, 'left');
$Plot->addYUnit(1, 'h');
$Plot->setYTicks(1, 1, 0);
$Plot->setYLimits(1, 0, $max);
$Plot->showBars(true);
$Plot->stacked();
$error = true;
开发者ID:n0rthface,项目名称:Runalyze,代码行数:31,代码来源:Plot.Weekday.php


示例19: __construct

 function __construct($datay, $datax = false)
 {
     if (count($datax) != count($datay) && is_array($datax)) {
         JpGraphError::RaiseL(20003);
         //("Scatterplot must have equal number of X and Y points.");
     }
     parent::__construct($datay, $datax);
     $this->mark = new PlotMark();
     $this->mark->SetType(MARK_SQUARE);
     $this->mark->SetColor($this->color);
     $this->value->SetAlign('center', 'center');
     $this->value->SetMargin(0);
     $this->link = new LineProperty(1, 'black', 'solid');
     $this->link->iShow = false;
 }
开发者ID:sandakinhs,项目名称:iCRM3,代码行数:15,代码来源:jpgraph_scatter.php


示例20: plotSpectra

 public static function plotSpectra()
 {
     $plot = new Plot();
     $plot->xlabel("Wavelength (nm)");
     $spectra = new Spectra();
     $spectra->loadOptions();
     // Make material selection if it exists
     if (isset($_GET['selection'])) {
         $selection = json_decode(urldecode($_GET['selection']));
         // print_r($selection);
         $x = array();
         $y = array();
         $legend = array();
         foreach ($selection as $type => $name_array) {
             $plot->ylabel($type . " (cm^2)");
             foreach ($name_array as $name => $axis_array) {
                 $plot->title($name . " " . $type . " Vs. Wavelength");
                 $n = 0;
                 foreach ($axis_array as $axis => $range_array) {
                     // print_r($axis);
                     $legend[$n] = $axis . " axis";
                     $y[$legend[$n]] = array();
                     foreach ($range_array as $range => $empty) {
                         if (!$spectra->selectOptions($type, $name, $axis, $range)) {
                             $errors[] = new UserError("Options do not exist", 1);
                         }
                         if ($n == 0) {
                             // only need wavelengths once
                             $x = array_merge($x, $spectra->getWavelengths());
                         }
                         $y[$legend[$n]] = array_merge($y[$legend[$n]], $spectra->getSignals());
                         $spectra->clearSelection();
                     }
                     $n = $n + 1;
                 }
             }
         }
         $plot->setX($x);
         $plot->setY($y);
         $plot->legend($legend);
         // Output plot data
         echo $plot->getJson();
     } else {
         // Output materials list
         echo $spectra->getJson();
     }
 }
开发者ID:hbrew,项目名称:lasersdb,代码行数:47,代码来源:data.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP PlotBand类代码示例发布时间:2022-05-23
下一篇:
PHP Playlist类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap