本文整理汇总了PHP中pData::setYAxisName方法的典型用法代码示例。如果您正苦于以下问题:PHP pData::setYAxisName方法的具体用法?PHP pData::setYAxisName怎么用?PHP pData::setYAxisName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pData
的用法示例。
在下文中一共展示了pData::setYAxisName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pu
$graph = new pu($width,$height,"auto");
$graph->SetScale("textlin");
$graph->img->SetMargin($marginleft,$marginright,$margintop,$marginbottom);
$graph->SetMarginColor($margincolor);
$graph->img->SetAntiAliasing();
$graph->SetColor($color);
$graph->SetShadow();
$graph->xaxis->SetTitleMargin($marginbottom - 35);
$graph->yaxis->SetTitleMargin(50);
$graph->yaxis->SetTitleMargin($marginleft - 15);
}
*/
// Create Graph Dataset and set axis attributes
$graphData = new pData();
$graphData->setYAxisName($ytitle);
$graphData->AddPoint($xlabels, "xaxis");
//$graphData->SetSerieName("xaxis","xaxis");
$graphData->SetAbsciseLabelSerie("xaxis");
$graphData->setXAxisName($xtitle);
// Add each series of plot values to dataset, but Reportico will
// duplicate series were the same data are displayed in different forms
// so only add each unique series once
$seriesadded = array();
foreach ($plot as $k => $v) {
$series = $v["name"] . $k;
$graphData->AddPoint($v["data"], $series);
$graphData->SetSerieName($v["legend"], $series);
$graphData->AddSerie($series);
}
/*
示例2: pData
function generate_graph_image($outputfile)
{
// Create Graph Dataset and set axis attributes
$graphData = new pData();
$graphData->setYAxisName($this->ytitle);
$graphData->AddPoint($this->xlabels, "xaxis");
//$graphData->SetSerieName("xaxis","xaxis");
$graphData->SetAbsciseLabelSerie("xaxis");
$graphData->setXAxisName($this->xtitle);
// Add each series of plot values to dataset, but Reportico will
// duplicate series were the same data are displayed in different forms
// so only add each unique series once
$seriesadded = array();
foreach ($this->plot as $k => $v) {
$series = $v["name"] . $k;
$graphData->AddPoint($v["data"], $series);
$graphData->SetSerieName($v["legend"], $series);
$graphData->AddSerie($series);
}
/*
switch ( $this->xgriddisplay )
{
case "all":
$graph->xgrid->Show(true,true);
break;
case "major":
$graph->xgrid->Show(true,false);
break;
case "minor":
$graph->xgrid->Show(false,true);
break;
case "none":
default:
$graph->xgrid->Show(false,false);
break;
}
switch ( $this->ygriddisplay )
{
case "all":
$graph->ygrid->Show(true,true);
break;
case "major":
$graph->ygrid->Show(true,false);
break;
case "minor":
$graph->ygrid->Show(false,true);
break;
case "none":
default:
$graph->ygrid->Show(false,false);
break;
}
*/
/*
$graph->xaxis->SetFont($fontfamilies[$xaxisfont],$fontstyles[$xaxisfontstyle], $xaxisfontsize);
$graph->xaxis->SetColor($xaxiscolor,$xaxisfontcolor);
$graph->yaxis->SetFont($fontfamilies[$yaxisfont],$fontstyles[$yaxisfontstyle], $yaxisfontsize);
$graph->yaxis->SetColor($yaxiscolor,$yaxisfontcolor);
$graph->xaxis->title->SetFont($fontfamilies[$xtitlefont],$fontstyles[$xtitlefontstyle], $xtitlefontsize);
$graph->xaxis->title->SetColor($xtitlecolor);
$graph->yaxis->title->SetFont($fontfamilies[$ytitlefont],$fontstyles[$ytitlefontstyle], $ytitlefontsize);
$graph->yaxis->title->SetColor($ytitlecolor);
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->SetLabelMargin(15);
$graph->yaxis->SetLabelMargin(15);
$graph->xaxis->SetTickLabels($this->xlabels);
$graph->xaxis->SetTextLabelInterval($xticklabint);
$graph->yaxis->SetTextLabelInterval($yticklabint);
$graph->xaxis->SetTextTickInterval($xtickinterval);
$graph->yaxis->SetTextTickInterval($ytickinterval);
*/
/*
if ( $gridpos == "front" )
$graph->SetGridDepth(DEPTH_FRONT);
*/
// Display the graph
/*?$graph->Stroke();*/
$this->apply_defaults_internal();
//echo $this->width_pdf_actual.",".$this->height_pdf_actual."<BR>";
$graphImage = new pChart($this->width_pdf_actual, $this->height_pdf_actual);
/* Turn of Antialiasing */
$graphImage->Antialias = TRUE;
// Add gradient fill from chosen background color to white
$startgradient = htmltorgb("#ffffff");
//$graphImage->drawGradientArea(0,0,$width,$height,DIRECTION_VERTICAL,array(
//"StartR"=>$startgradient[0], "StartG"=>$startgradient[1], "StartB"=>$startgradient[2],
//"EndR"=>$color[0], "EndG"=>$color[1], "EndB"=>$color[2],"Alpha"=>100));
/* Add a border to the picture */
//$graphImage->drawRectangle(0,0,$width - 1,$height - 1,200,200,200);
$graphImage->setFontProperties(PCHARTFONTS_DIR . $this->xaxisfont, $this->xaxisfontsize);
/* Define the chart area */
$graphImage->setGraphArea($this->marginleft_actual, $this->margintop_actual, $this->width_pdf_actual - $this->marginright_actual, $this->height_pdf_actual - $this->marginbottom_actual);
$graphImage->drawFilledRoundedRectangle(3, 3, $this->width_pdf_actual - 3, $this->height_pdf_actual - 3, 5, 240, 240, 240);
$graphImage->drawRoundedRectangle(1, 1, $this->width_pdf_actual - 1, $this->height_pdf_actual - 1, 5, 230, 230, 230);
// Before plotting a series ensure they are all not drawable.
/// Plot the chart data
$stackeddrawn = false;
$linedrawn = false;
$scatterdrawn = false;
//.........这里部分代码省略.........
示例3: history
/**
* Create a history graph for the given info type
*
* @param $info
*/
protected function history($info)
{
$diff = abs(strtotime($this->from) - strtotime($this->to));
$days = floor($diff / (60 * 60 * 24));
if ($days > 365) {
$interval = 'months';
} elseif ($days > 56) {
$interval = 'weeks';
} else {
$interval = 'days';
}
$result = $this->hlp->Query()->history($this->tlimit, $info, $interval);
$data = array();
$times = array();
foreach ($result as $row) {
$data[] = $row['cnt'];
if ($interval == 'months') {
$times[] = substr($row['time'], 0, 4) . '-' . substr($row['time'], 4, 2);
} elseif ($interval == 'weeks') {
$times[] = $row['EXTRACT(YEAR FROM dt)'] . '-' . $row['time'];
} else {
$times[] = substr($row['time'], -5);
}
}
$DataSet = new pData();
$DataSet->AddPoints($data, 'Serie1');
$DataSet->AddPoints($times, 'Times');
$DataSet->AddAllSeries();
$DataSet->SetAbscissaLabelSeries('Times');
$DataSet->setXAxisName($this->hlp->getLang($interval));
$DataSet->setYAxisName($this->hlp->getLang('graph_' . $info));
$Canvas = new GDCanvas(600, 200, false);
$Chart = new pChart(600, 200, $Canvas);
$Chart->setFontProperties(dirname(__FILE__) . '/pchart/Fonts/DroidSans.ttf', 8);
$Chart->setGraphArea(50, 10, 580, 140);
$Chart->drawScale($DataSet, new ScaleStyle(SCALE_NORMAL, new Color(127)), 45, 1, false, ceil(count($times) / 12));
$Chart->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
$DataSet->removeSeries('Times');
$DataSet->removeSeriesName('Times');
header('Content-Type: image/png');
$Chart->Render('');
}