本文整理汇总了PHP中pChart::reportWarnings方法的典型用法代码示例。如果您正苦于以下问题:PHP pChart::reportWarnings方法的具体用法?PHP pChart::reportWarnings怎么用?PHP pChart::reportWarnings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pChart
的用法示例。
在下文中一共展示了pChart::reportWarnings方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pData
//.........这里部分代码省略.........
$graphImage->drawPieGraph($graphData->GetData(), $graphData->GetDataDescription(), $this->width_pdf_actual / 2, $this->margintop_actual + ($this->height_pdf_actual - $this->margintop_actual - $this->marginbottom_actual) / 2, ($this->height_pdf_actual - $this->marginbottom_actual - $this->margintop_actual - 20) * 0.5, PIE_PERCENTAGE_LABEL, true, 60, 20, 0, 0);
break;
case "OVERLAYBAR":
case "STACKEDBAR":
case "BAR":
if ($stackeddrawn) {
break;
}
if ($barexists || $overlayexists) {
foreach ($this->plot as $k1 => $v1) {
if ($v1["type"] == "BAR" || $v1["type"] == "STACKEDBAR" || $v1["type"] == "OVERLAYBAR") {
setSerieDrawable($this->plot, $graphData, $v1["name"] . $k1, TRUE);
}
}
}
$stackeddrawn = true;
if ($stackedexists) {
$graphImage->drawStackedBarGraph($graphData->GetData(), $graphData->GetDataDescription(), 90);
} else {
if ($overlayexists) {
$graphImage->drawOverlayBarGraph($graphData->GetData(), $graphData->GetDataDescription(), 90);
} else {
$graphImage->drawBarGraph($graphData->GetData(), $graphData->GetDataDescription());
}
}
break;
case "SCATTER":
if ($scatterdrawn) {
break;
}
$scatterdrawn = true;
$series1 = false;
$series2 = false;
$graphImage->reportWarnings("GD");
$ct = 0;
foreach ($this->plot as $k1 => $v1) {
if ($v1["type"] == "SCATTER") {
if ($ct == 0) {
$series1 = $v1["name"] . $k1;
}
if ($ct == 1) {
$series2 = $v1["name"] . $k1;
}
$ct++;
setSerieDrawable($this->plot, $graphData, $v1["name"] . $k1, TRUE);
}
}
if (count($v["data"]) == 1) {
$v["data"][] = 0;
}
$graphImage->drawXYScale($graphData->GetData(), $graphData->GetDataDescription(), $series1, $series2, 0, 0, 0);
//$graphImage->drawXYGraph($graphData->GetData(), $graphData->GetDataDescription(), $series1, $series2);
$graphImage->drawXYPlotGraph($graphData->GetData(), $graphData->GetDataDescription(), $series1, $series2);
$graphImage->writeValues($graphData->GetData(), $graphData->GetDataDescription(), $series2);
break;
case "LINE":
default:
if ($linedrawn) {
break;
}
$linedrawn = true;
foreach ($this->plot as $k1 => $v1) {
if ($v1["type"] == "LINE") {
setSerieDrawable($this->plot, $graphData, $v1["name"] . $k1, TRUE);
}
}
示例2: pData
*/
// Standard inclusions
include "pChart/pData.class";
include "pChart/pChart.class";
// Dataset definition
$DataSet = new pData();
$DataSet->AddPoint(array(10, 4, 3, 2, 3, 3, 2, 1, 0, 7, 4, 3, 2, 3, 3, 5, 1, 0, 7), "Serie1");
$DataSet->AddPoint(array(1, 4, 2, 6, 2, 3, 0, 1, -5, 1, 2, 4, 5, 2, 1, 0, 6, 4, 30), "Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetXAxisName("Samples");
$DataSet->SetYAxisName("Temperature");
$DataSet->SetSerieName("January", "Serie1");
// Initialise the graph
$Test = new pChart(700, 230);
$Test->reportWarnings("GD");
$Test->setFontProperties("Fonts/tahoma.ttf", 8);
$Test->setGraphArea(60, 30, 585, 185);
$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240);
$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230);
$Test->drawGraphArea(255, 255, 255, TRUE);
$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2);
$Test->drawGrid(4, TRUE, 230, 230, 230, 50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf", 6);
$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
// Draw the cubic curve graph
$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription());
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf", 8);
$Test->drawLegend(600, 30, $DataSet->GetDataDescription(), 255, 255, 255);
示例3: testDrawArea
public function testDrawArea()
{
// Dataset definition
$DataSet = new pData();
$DataSet->addPoints(array(10, 9.4, 7.7, 5, 1.7, -1.7, -5, -7.7, -9.4, -10, -9.4, -7.7, -5, -1.8, 1.7), "Serie1");
$DataSet->addPoints(array(0, 3.4, 6.4, 8.699999999999999, 9.800000000000001, 9.800000000000001, 8.699999999999999, 6.4, 3.4, 0, -3.4, -6.4, -8.6, -9.800000000000001, -9.9), "Serie2");
$DataSet->addPoints(array(7.1, 9.1, 10, 9.699999999999999, 8.199999999999999, 5.7, 2.6, -0.9, -4.2, -7.1, -9.1, -10, -9.699999999999999, -8.199999999999999, -5.8), "Serie3");
$DataSet->addPoints(array("Jan", "Jan", "Jan", "Feb", "Feb", "Feb", "Mar", "Mar", "Mar", "Apr", "Apr", "Apr", "May", "May", "May"), "Serie4");
$DataSet->AddAllSeries();
$DataSet->SetAbscissaLabelSeries("Serie4");
$DataSet->SetSeriesName("Max Average", "Serie1");
$DataSet->SetSeriesName("Min Average", "Serie2");
$DataSet->SetSeriesName("Temperature", "Serie3");
$DataSet->SetYAxisName("Temperature");
$DataSet->SetXAxisName("Month of the year");
// Initialise the graph
$canvas = new TestCanvas();
$Test = new pChart(700, 230, $canvas);
$Test->reportWarnings("GD");
$Test->setFixedScale(-12, 12, 5);
$Test->setFontProperties("Fonts/tahoma.ttf", 8);
$Test->setGraphArea(65, 30, 570, 185);
$canvas->drawFilledRoundedRectangle(new Point(7, 7), new Point(693, 223), 5, new Color(240), 1, 0, ShadowProperties::NoShadow());
$backgroundStyle = new BackgroundStyle(new Color(255), TRUE);
$Test->drawGraphBackground($backgroundStyle);
$scaleStyle = new ScaleStyle(SCALE_NORMAL, new Color(150));
$Test->drawScale($DataSet, $scaleStyle, 0, 2, TRUE, 3);
$Test->drawGrid(new GridStyle(4, TRUE, new Color(230), 50));
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf", 6);
$Test->drawTreshold(0, new Color(143, 55, 72), TRUE, TRUE);
// Draw the area
$DataSet->RemoveSeries("Serie4");
$Test->drawArea($DataSet->GetData(), "Serie1", "Serie2", new Color(239, 238, 227), 50);
$DataSet->RemoveSeries("Serie3");
$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
// Draw the line graph
$Test->setLineStyle(1, 6);
$DataSet->RemoveAllSeries();
$DataSet->AddSeries("Serie3");
$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, new Color(255));
// Write values on Serie3
$Test->setFontProperties("Fonts/tahoma.ttf", 8);
$Test->writeValues($DataSet->GetData(), $DataSet->GetDataDescription(), "Serie3");
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf", 8);
$Test->drawLegend(590, 90, $DataSet->GetDataDescription(), new Color(255));
$Test->setFontProperties("Fonts/tahoma.ttf", 10);
$Test->drawTitle(60, 22, "example 15", new Color(50), 585);
// Add an image
$Test->drawFromPNG(dirname(__FILE__) . "/../Sample/logo.png", 584, 35);
$this->assertEquals('53b34d556af518230b7556e19349bd94', md5($canvas->getActionLog()));
}
示例4: foreach
} else {
if ($overlayexists) {
$graphImage->drawOverlayBarGraph($graphData->GetData(), $graphData->GetDataDescription(), 90);
} else {
$graphImage->drawBarGraph($graphData->GetData(), $graphData->GetDataDescription());
}
}
break;
case "SCATTER":
if ($scatterdrawn) {
break;
}
$scatterdrawn = true;
$series1 = false;
$series2 = false;
$graphImage->reportWarnings("GD");
$ct = 0;
foreach ($plot as $k1 => $v1) {
if ($v1["type"] == "SCATTER") {
if ($ct == 0) {
$series1 = $v1["name"] . $k1;
}
if ($ct == 1) {
$series2 = $v1["name"] . $k1;
}
$ct++;
setSerieDrawable($plot, $graphData, $v1["name"] . $k1, TRUE);
}
}
if (count($v["data"]) == 1) {
$v["data"][] = 0;
示例5: createChart
function createChart(&$info, &$cfg)
{
$backgndColor = array('R' => 255, 'G' => 255, 'B' => 254);
$chartCfg = new stdClass();
$chartCfg->XSize = $info->canDraw ? $cfg->XSize : 600;
$chartCfg->YSize = $info->canDraw ? $cfg->YSize : 50;
$chartCfg->border = new stdClass();
$chartCfg->border->width = 1;
$chartCfg->border->color = array('R' => 0, 'G' => 0, 'B' => 0);
$chartCfg->graphArea = new stdClass();
$chartCfg->graphArea->color = array('R' => 213, 'G' => 217, 'B' => 221);
$chartCfg->graphArea->beginX = property_exists($cfg, 'beginX') ? $cfg->beginX : 40;
$chartCfg->graphArea->beginY = property_exists($cfg, 'beginY') ? $cfg->beginY : 100;
$chartCfg->graphArea->endX = $chartCfg->XSize - $chartCfg->graphArea->beginX;
$chartCfg->graphArea->endY = $chartCfg->YSize - $chartCfg->graphArea->beginY;
$chartCfg->scale = new stdClass();
// 20100914 - franciscom
// After reading documentation
// drawScale
// Today there is four way of computing scales :
//
// - Getting Max & Min values per serie : ScaleMode = SCALE_NORMAL
// - Like the previous one but setting the min value to 0 : ScaleMode = SCALE_START0
// - Getting the series cumulative Max & Min values : ScaleMode = SCALE_ADDALL
// - Like the previous one but setting the min value to 0 : ScaleMode = SCALE_ADDALLSTART0
//
// This will depends on the kind of graph you are drawing, today only the stacked bar chart
// can use the SCALE_ADDALL mode.
// Drawing graphs were you want to fix the min value to 0 you must use the SCALE_START0 option.
//
$chartCfg->scale->mode = SCALE_ADDALLSTART0;
$chartCfg->scale->color = array('R' => 0, 'G' => 0, 'B' => 0);
$chartCfg->scale->drawTicks = TRUE;
$chartCfg->scale->angle = $cfg->scale->legendXAngle;
$chartCfg->scale->decimals = 1;
$chartCfg->scale->withMargin = TRUE;
$chartCfg->legend = new stdClass();
$chartCfg->legend->X = $chartCfg->XSize - 80;
$chartCfg->legend->Y = 15;
$chartCfg->legend->color = array('R' => 236, 'G' => 238, 'B' => 240);
$chartCfg->title = new stdClass();
$chartCfg->title->value = $cfg->chartTitle;
$chartCfg->title->X = 2 * $chartCfg->graphArea->beginX;
$chartCfg->title->Y = $chartCfg->legend->Y;
$chartCfg->title->color = array('R' => 0, 'G' => 0, 'B' => 255);
$Test = new pChart($chartCfg->XSize, $chartCfg->YSize);
$Test->reportWarnings("GD");
$Test->drawBackground($backgndColor['R'], $backgndColor['G'], $backgndColor['B']);
$Test->drawGraphArea($chartCfg->graphArea->color['R'], $chartCfg->graphArea->color['G'], $chartCfg->graphArea->color['B']);
$Test->setGraphArea($chartCfg->graphArea->beginX, $chartCfg->graphArea->beginY, $chartCfg->graphArea->endX, $chartCfg->graphArea->endY);
$Test->setFontProperties(config_get('charts_font_path'), config_get('charts_font_size'));
if ($info->canDraw) {
$DataSet = new pData();
foreach ($info->chart_data as $key => $values) {
$id = $key + 1;
$DataSet->AddPoint($values, "Serie{$id}");
$DataSet->SetSerieName($info->series_label[$key], "Serie{$id}");
}
$DataSet->AddPoint($info->xAxis->values, $info->xAxis->serieName);
$DataSet->AddAllSeries();
$DataSet->RemoveSerie($info->xAxis->serieName);
$DataSet->SetAbsciseLabelSerie($info->xAxis->serieName);
$chartData = $DataSet->GetData();
$chartLegend = $DataSet->GetDataDescription();
foreach ($info->series_color as $key => $hexrgb) {
$rgb = str_split($hexrgb, 2);
$Test->setColorPalette($key, hexdec($rgb[0]), hexdec($rgb[1]), hexdec($rgb[2]));
}
// $Test->setFixedScale($info->scale->minY,$info->scale->maxY,$info->scale->divisions);
$Test->drawScale($chartData, $chartLegend, $chartCfg->scale->mode, $chartCfg->scale->color['R'], $chartCfg->scale->color['G'], $chartCfg->scale->color['B'], $chartCfg->scale->drawTicks, $chartCfg->scale->angle, $chartCfg->scale->decimals, $chartCfg->scale->withMargin);
$Test->drawStackedBarGraph($chartData, $chartLegend, 70);
// Draw the legend
$Test->setFontProperties(config_get('charts_font_path'), config_get('charts_font_size'));
$Test->drawLegend($chartCfg->legend->X, $chartCfg->legend->Y, $chartLegend, $chartCfg->legend->color['R'], $chartCfg->legend->color['G'], $chartCfg->legend->color['B']);
$Test->addBorder($chartCfg->border->width, $chartCfg->border->color['R'], $chartCfg->border->color['G'], $chartCfg->border->color['B']);
} else {
$chartCfg->title->value .= '/' . lang_get('no_data_available');
}
$Test->drawTitle($chartCfg->title->X, $chartCfg->title->Y, $chartCfg->title->value, $chartCfg->title->color['R'], $chartCfg->title->color['G'], $chartCfg->title->color['B']);
$Test->Stroke();
}